Skip to content

Commit

Permalink
new patches for new static build params
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@3548 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jun 3, 2013
1 parent ebfdc3c commit 8426422
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 13 deletions.
20 changes: 20 additions & 0 deletions debian/patches/use-static-avcodec.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Description: Build dec_avcodec as a static library.
Author: Arthur Huillet <[email protected]>
Author: Antoine Martin <[email protected]>
Forwarded: not-needed

--- a/setup.py (revision 3545)
+++ b/setup.py (working copy)
@@ -947,7 +947,11 @@

toggle_packages(dec_avcodec_ENABLED, "xpra.codecs.dec_avcodec")
if dec_avcodec_ENABLED:
- avcodec_pkgconfig = pkgconfig("libavcodec")
+ avcodec_pkgconfig = {'include_dirs': ["/usr/local/include"],
+ 'library_dirs': ["/usr/local/lib"],
+ 'extra_link_args': ["-Wl,-soname,x264lib.so", "-Wl,-Bstatic", "-Wl,-Bsymbolic",
+ "-lavcodec", "-lavutil", "-Wl,-Bdynamic"]
+ }
cython_add(Extension("xpra.codecs.dec_avcodec.decoder",
["xpra/codecs/dec_avcodec/decoder.pyx", "xpra/codecs/dec_avcodec/dec_avcodec.c"],
**avcodec_pkgconfig), min_version=(0, 16))
20 changes: 20 additions & 0 deletions debian/patches/use-static-swscale.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Description: Build csc_swscale as a static library.
Author: Arthur Huillet <[email protected]>
Author: Antoine Martin <[email protected]>
Forwarded: not-needed

--- a/setup.py (revision 3545)
+++ b/setup.py (working copy)
@@ -954,7 +954,11 @@

toggle_packages(csc_swscale_ENABLED, "xpra.codecs.csc_swscale")
if csc_swscale_ENABLED:
- swscale_pkgconfig = pkgconfig("libswscale")
+ swscale_pkgconfig = {'include_dirs': ["/usr/local/include"],
+ 'library_dirs': ["/usr/local/lib"],
+ 'extra_link_args': ["-Wl,-soname,x264lib.so", "-Wl,-Bstatic", "-Wl,-Bsymbolic",
+ "-lswscale", "-Wl,-Bdynamic"]
+ }
cython_add(Extension("xpra.codecs.csc_swscale.colorspace_converter",
["xpra/codecs/csc_swscale/colorspace_converter.pyx", "xpra/codecs/csc_swscale/csc_swscale.c"],
**swscale_pkgconfig), min_version=(0, 16))
2 changes: 1 addition & 1 deletion debian/patches/use-static-x264lib.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Description: Build x264 codec as a static library.
+ x264_pkgconfig = {'include_dirs': ["/usr/local/include"],
+ 'library_dirs': ["/usr/local/lib"],
+ 'extra_link_args': ["-Wl,-soname,x264lib.so", "-Wl,-Bstatic", "-Wl,-Bsymbolic",
+ "-lx264", "-lswscale", "-lavcodec", "-lavutil", "-Wl,-Bdynamic"]
+ "-lx264", "-Wl,-Bdynamic"]
+ }
cython_add(Extension("xpra.codecs.enc_x264.encoder",
["xpra/codecs/enc_x264/encoder.pyx", "xpra/codecs/enc_x264/enc_x264.c"],
Expand Down
26 changes: 15 additions & 11 deletions scripts/xpra.spec
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@
%if %(egrep -q 'release 7|release 6.3|release 6.4|release 6.5|release 6.6|release 6.7|release 6.8|release 6.9' /etc/redhat-release && echo 1 || echo 0)
%define requires_opengl , PyOpenGL, pygtkglext
%endif
%if 0%{?static_video_libs}
%define static_x264 1
%define static_vpx 1
%endif
#6.4 has dummy support, but detection fails because of console ownership issues..
#so override and set it for 6.4 and later
%if %(egrep -q 'release 7|release 6.4|release 6.5|release 6.6|release 6.7|release 6.8|release 6.9' /etc/redhat-release && echo 1 || echo 0)
Expand All @@ -82,10 +78,13 @@
#uuidgen is in e2fsprogs! (no we don't do any fs stuff)
%define requires_extra , e2fsprogs, python-ctypes
%define include_egg 0
%endif

%if 0%{?static_video_libs}
%define static_x264 1
%define static_vpx 1
%endif
%define static_avcodec 1
%define static_swscale 1
%endif

%if 0%{?no_webp}
Expand Down Expand Up @@ -134,11 +133,12 @@ Patch2: disable-vpx.patch
Patch3: disable-webp.patch
Patch4: use-static-x264lib.patch
Patch5: use-static-vpxlib.patch
Patch6: x264-limited-csc.patch
Patch7: no-strict.patch
Patch8: old-libav.patch
Patch9: disable-pulseaudio.patch
Patch10: old-xdg-desktop.patch
Patch11: use-static-avcodec.patch
Patch12: use-static-swscale.patch


%description
Expand Down Expand Up @@ -757,17 +757,13 @@ cd xpra-all-%{version}
%patch5 -p1
(echo "setup.py" > %{S:ignored_changed_files.txt})
%endif
%if 0%{?limited_csc}
%patch6 -p1
(echo "xpra/codecs/x264/x264lib.c" > %{S:ignored_changed_files.txt})
%endif
%if 0%{?no_strict}
%patch7 -p1
(echo "setup.py" > %{S:ignored_changed_files.txt})
%endif
%if 0%{?old_libav}
%patch8 -p1
(echo "xpra/codecs/x264/x264lib.c" > %{S:ignored_changed_files.txt})
(echo "xpra/codecs/dec_avcodec/dec_avcodec.c" > %{S:ignored_changed_files.txt})
%endif
%if 0%{?no_pulseaudio}
%patch9 -p1
Expand All @@ -776,6 +772,14 @@ cd xpra-all-%{version}
%if 0%{?old_xdg}
%patch10 -p1
(echo "xdg/*.desktop" > %{S:ignored_changed_files.txt})
%if 0%{?static_avcodec}
%patch11 -p1
(echo "setup.py" > %{S:ignored_changed_files.txt})
%endif
%if 0%{?static_swscale}
%patch12 -p1
(echo "setup.py" > %{S:ignored_changed_files.txt})
%endif
%endif


Expand Down
20 changes: 20 additions & 0 deletions src/patches/use-static-avcodec.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Description: Build dec_avcodec as a static library.
Author: Arthur Huillet <[email protected]>
Author: Antoine Martin <[email protected]>
Forwarded: not-needed

--- a/setup.py (revision 3545)
+++ b/setup.py (working copy)
@@ -947,7 +947,11 @@

toggle_packages(dec_avcodec_ENABLED, "xpra.codecs.dec_avcodec")
if dec_avcodec_ENABLED:
- avcodec_pkgconfig = pkgconfig("libavcodec")
+ avcodec_pkgconfig = {'include_dirs': ["/usr/local/include"],
+ 'library_dirs': ["/usr/local/lib"],
+ 'extra_link_args': ["-Wl,-soname,x264lib.so", "-Wl,-Bstatic", "-Wl,-Bsymbolic",
+ "-lavcodec", "-lavutil", "-Wl,-Bdynamic"]
+ }
cython_add(Extension("xpra.codecs.dec_avcodec.decoder",
["xpra/codecs/dec_avcodec/decoder.pyx", "xpra/codecs/dec_avcodec/dec_avcodec.c"],
**avcodec_pkgconfig), min_version=(0, 16))
20 changes: 20 additions & 0 deletions src/patches/use-static-swscale.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Description: Build csc_swscale as a static library.
Author: Arthur Huillet <[email protected]>
Author: Antoine Martin <[email protected]>
Forwarded: not-needed

--- a/setup.py (revision 3545)
+++ b/setup.py (working copy)
@@ -954,7 +954,11 @@

toggle_packages(csc_swscale_ENABLED, "xpra.codecs.csc_swscale")
if csc_swscale_ENABLED:
- swscale_pkgconfig = pkgconfig("libswscale")
+ swscale_pkgconfig = {'include_dirs': ["/usr/local/include"],
+ 'library_dirs': ["/usr/local/lib"],
+ 'extra_link_args': ["-Wl,-soname,x264lib.so", "-Wl,-Bstatic", "-Wl,-Bsymbolic",
+ "-lswscale", "-Wl,-Bdynamic"]
+ }
cython_add(Extension("xpra.codecs.csc_swscale.colorspace_converter",
["xpra/codecs/csc_swscale/colorspace_converter.pyx", "xpra/codecs/csc_swscale/csc_swscale.c"],
**swscale_pkgconfig), min_version=(0, 16))
2 changes: 1 addition & 1 deletion src/patches/use-static-x264lib.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Description: Build x264 codec as a static library.
+ x264_pkgconfig = {'include_dirs': ["/usr/local/include"],
+ 'library_dirs': ["/usr/local/lib"],
+ 'extra_link_args': ["-Wl,-soname,x264lib.so", "-Wl,-Bstatic", "-Wl,-Bsymbolic",
+ "-lx264", "-lswscale", "-lavcodec", "-lavutil", "-Wl,-Bdynamic"]
+ "-lx264", "-Wl,-Bdynamic"]
+ }
cython_add(Extension("xpra.codecs.enc_x264.encoder",
["xpra/codecs/enc_x264/encoder.pyx", "xpra/codecs/enc_x264/enc_x264.c"],
Expand Down

0 comments on commit 8426422

Please sign in to comment.