Skip to content

Commit

Permalink
sjpeg is finally building.
Browse files Browse the repository at this point in the history
latest.sh can now retrieve the latest commit on Master in github
repositories

download.sh correctly deals with .zip files now. Also switch from
p7zip to unzip when dealing with .zip because the current version
of p7zip (17.05) has a very dangerous bug in the zip file handler
p7zip-project/p7zip#112
  • Loading branch information
libTorrentUser committed Apr 22, 2023
1 parent 3b3781a commit cad2807
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 21 deletions.
32 changes: 19 additions & 13 deletions cfg/build/package/sjpeg
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PackageBuild()

local sourceDir;
sourceDir=$(./latest.sh \
--host='github' \
--host='github-master' \
--package="webmproject/${package}" \
-b="$buildDir"
);
Expand All @@ -56,16 +56,22 @@ PackageBuild()
DieIfFails ./make.sh \
-b="$buildDir" \
-s="$sourceDir" \
--configure-options="\
--prefix=$prefix \
" \
--dest-dir="$destDir" \
--install-options="install-strip";

local pkgconfigDir="$dirBin/pkgconfig";

DieIfFails ./adjust-pkgconfig.sh \
-d="$destDir" \
--prefix="$prefix" \
-o="$pkgconfigDir";
--in-source \
--no-configure \
--no-install;

# manually install. Because there ain't none of that in the makefile
Log 'Manually installing...'

local installDir="${destDir}/${prefix}";
printf 'installing to "%s"\n' "$installDir";

DieIfFails DeleteAllFiles "$installDir";

for d in include lib; do
DieIfFails mkdir -p "${installDir}/${d}";
done

DieIfFails cp "${sourceDir}/src/sjpeg.h" "${installDir}/include/"
DieIfFails cp "${sourceDir}/src/libsjpeg.a" "${installDir}/lib/"
}
16 changes: 16 additions & 0 deletions cfg/build/patch/sjpeg/00-remove.glut.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- sjpeg-master/Makefile
+++ new/Makefile
@@ -22,13 +22,9 @@
EXTRA_FLAGS += -I/opt/local/include
EXTRA_FLAGS += -Wno-deprecated-declarations
EXTRA_LIBS += -L/opt/local/lib
- GL_LIBS = -framework GLUT -framework OpenGL
- EXTRA_FLAGS += -DHAVE_GLUT_GLUT_H
else
EXTRA_FLAGS += -I/usr/local/include
EXTRA_LIBS += -L/usr/local/lib
- GL_LIBS = -lglut -lGL
- EXTRA_FLAGS += -DHAVE_GL_GLUT_H
endif

# Uncomment for build for 32bit platform
20 changes: 14 additions & 6 deletions cfg/build/script/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,16 @@ ExtractSource()
# contents with "tar -t" or extract it. Since we are going to extract it
# anyway...
if ! tar -C "$_tmpDir" -xf "${_buildDir}/${_tarName}"; then
# if tar fails, try extracting with 7z. 7z will output a bunch of stuff
# so we must redirect the output to /dev/null
DieIfFails 7z x "${_buildDir}/${_tarName}" -o"$_tmpDir" > /dev/null
case "$_tarName" in
*.zip)
DieIfFails unzip -q -d "$_tmpDir" "${_buildDir}/${_tarName}";
;;
*)
# try extracting with 7z. 7z will output a bunch of stuff
# so we must redirect the output to /dev/null
DieIfFails 7z x "${_buildDir}/${_tarName}" -o"${_tmpDir}/" > /dev/null
;;
esac
fi

local version=$(find "$_tmpDir" -maxdepth 1 -mindepth 1);
Expand All @@ -140,12 +147,13 @@ ExtractSource()
Die "unable to retrieve the latest version name";
fi

# and now we can finaly move it out of there
# and now we can finaly move it out of there
DieIfFails rm -rf "${_buildDir}/${version}";
DieIfFails mv "${_tmpDir}/${version}" "${_buildDir}/"

local sourceDir="${_buildDir}/"$(printf '%s' "$version" | sed 's;\(.*\).tar.*$;\1;');

#local sourceDir="${_buildDir}/"$(printf '%s' "$version" | sed 's;\(.*\).tar.*$;\1;');
local sourceDir="${_buildDir}/${version}";

printf '%s' "$sourceDir";
}

Expand Down
16 changes: 14 additions & 2 deletions cfg/build/script/latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ PrintUsage()
--gnome-ignore9x
useful when dealing with GTK related packages because GTK devs are insane
and decided that the .9x branches are actualy betas of the next major
version.
version.
--host
lots of source codes are stored in very popular hosts. That (sometimes)
Expand All @@ -62,8 +62,11 @@ PrintUsage()
selecting the correct one, you can use --github-regex to specify a regular
expression capable of selected the one you need.
"github-master"
retrieve the latest commit on the master branch.
"github-tag"
same as above, but the project is using tags instead of releases
same as "github", but the project is using tags instead of releases
"gitlab"
package is hosted on gitlab and the latest source code can be retrieved
Expand Down Expand Up @@ -311,6 +314,12 @@ content:
}


GithubMaster()
{
_urlTar="https://github.com/${_package}/archive/master.zip";
}


GithubTag()
{
local url="https://api.github.com/repos/${_package}/tags";
Expand Down Expand Up @@ -528,6 +537,9 @@ LatestVersion()
github)
Github;
;;
github-master)
GithubMaster;
;;
github-tag)
GithubTag;
;;
Expand Down

0 comments on commit cad2807

Please sign in to comment.