Skip to content

Commit cad2807

Browse files
author
libTorrentUser
committed
sjpeg is finally building.
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
1 parent 3b3781a commit cad2807

File tree

4 files changed

+63
-21
lines changed

4 files changed

+63
-21
lines changed

cfg/build/package/sjpeg

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ PackageBuild()
3939

4040
local sourceDir;
4141
sourceDir=$(./latest.sh \
42-
--host='github' \
42+
--host='github-master' \
4343
--package="webmproject/${package}" \
4444
-b="$buildDir"
4545
);
@@ -56,16 +56,22 @@ PackageBuild()
5656
DieIfFails ./make.sh \
5757
-b="$buildDir" \
5858
-s="$sourceDir" \
59-
--configure-options="\
60-
--prefix=$prefix \
61-
" \
62-
--dest-dir="$destDir" \
63-
--install-options="install-strip";
64-
65-
local pkgconfigDir="$dirBin/pkgconfig";
66-
67-
DieIfFails ./adjust-pkgconfig.sh \
68-
-d="$destDir" \
69-
--prefix="$prefix" \
70-
-o="$pkgconfigDir";
59+
--in-source \
60+
--no-configure \
61+
--no-install;
62+
63+
# manually install. Because there ain't none of that in the makefile
64+
Log 'Manually installing...'
65+
66+
local installDir="${destDir}/${prefix}";
67+
printf 'installing to "%s"\n' "$installDir";
68+
69+
DieIfFails DeleteAllFiles "$installDir";
70+
71+
for d in include lib; do
72+
DieIfFails mkdir -p "${installDir}/${d}";
73+
done
74+
75+
DieIfFails cp "${sourceDir}/src/sjpeg.h" "${installDir}/include/"
76+
DieIfFails cp "${sourceDir}/src/libsjpeg.a" "${installDir}/lib/"
7177
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--- sjpeg-master/Makefile
2+
+++ new/Makefile
3+
@@ -22,13 +22,9 @@
4+
EXTRA_FLAGS += -I/opt/local/include
5+
EXTRA_FLAGS += -Wno-deprecated-declarations
6+
EXTRA_LIBS += -L/opt/local/lib
7+
- GL_LIBS = -framework GLUT -framework OpenGL
8+
- EXTRA_FLAGS += -DHAVE_GLUT_GLUT_H
9+
else
10+
EXTRA_FLAGS += -I/usr/local/include
11+
EXTRA_LIBS += -L/usr/local/lib
12+
- GL_LIBS = -lglut -lGL
13+
- EXTRA_FLAGS += -DHAVE_GL_GLUT_H
14+
endif
15+
16+
# Uncomment for build for 32bit platform

cfg/build/script/download.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,16 @@ ExtractSource()
128128
# contents with "tar -t" or extract it. Since we are going to extract it
129129
# anyway...
130130
if ! tar -C "$_tmpDir" -xf "${_buildDir}/${_tarName}"; then
131-
# if tar fails, try extracting with 7z. 7z will output a bunch of stuff
132-
# so we must redirect the output to /dev/null
133-
DieIfFails 7z x "${_buildDir}/${_tarName}" -o"$_tmpDir" > /dev/null
131+
case "$_tarName" in
132+
*.zip)
133+
DieIfFails unzip -q -d "$_tmpDir" "${_buildDir}/${_tarName}";
134+
;;
135+
*)
136+
# try extracting with 7z. 7z will output a bunch of stuff
137+
# so we must redirect the output to /dev/null
138+
DieIfFails 7z x "${_buildDir}/${_tarName}" -o"${_tmpDir}/" > /dev/null
139+
;;
140+
esac
134141
fi
135142

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

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

147-
local sourceDir="${_buildDir}/"$(printf '%s' "$version" | sed 's;\(.*\).tar.*$;\1;');
148-
154+
#local sourceDir="${_buildDir}/"$(printf '%s' "$version" | sed 's;\(.*\).tar.*$;\1;');
155+
local sourceDir="${_buildDir}/${version}";
156+
149157
printf '%s' "$sourceDir";
150158
}
151159

cfg/build/script/latest.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ PrintUsage()
4242
--gnome-ignore9x
4343
useful when dealing with GTK related packages because GTK devs are insane
4444
and decided that the .9x branches are actualy betas of the next major
45-
version.
45+
version.
4646
4747
--host
4848
lots of source codes are stored in very popular hosts. That (sometimes)
@@ -62,8 +62,11 @@ PrintUsage()
6262
selecting the correct one, you can use --github-regex to specify a regular
6363
expression capable of selected the one you need.
6464
65+
"github-master"
66+
retrieve the latest commit on the master branch.
67+
6568
"github-tag"
66-
same as above, but the project is using tags instead of releases
69+
same as "github", but the project is using tags instead of releases
6770
6871
"gitlab"
6972
package is hosted on gitlab and the latest source code can be retrieved
@@ -311,6 +314,12 @@ content:
311314
}
312315

313316

317+
GithubMaster()
318+
{
319+
_urlTar="https://github.com/${_package}/archive/master.zip";
320+
}
321+
322+
314323
GithubTag()
315324
{
316325
local url="https://api.github.com/repos/${_package}/tags";
@@ -528,6 +537,9 @@ LatestVersion()
528537
github)
529538
Github;
530539
;;
540+
github-master)
541+
GithubMaster;
542+
;;
531543
github-tag)
532544
GithubTag;
533545
;;

0 commit comments

Comments
 (0)