lol

Merge pull request #29028 from obsidiansystems/cross-cleanup

misc pkgs: Clean up cross

authored by

John Ericson and committed by
GitHub
5b6d7819 abdd0bbf

+86 -83
-3
pkgs/applications/editors/zile/default.nix
··· 11 11 buildInputs = [ pkgconfig ncurses boehmgc ]; 12 12 nativeBuildInputs = [ help2man perl ]; 13 13 14 - # `help2man' wants to run Zile, which fails when cross-compiling. 15 - crossAttrs.nativeBuildInputs = []; 16 - 17 14 # Tests can't be run because most of them rely on the ability to 18 15 # fiddle with the terminal. 19 16 doCheck = false;
+25 -24
pkgs/applications/networking/browsers/elinks/default.nix
··· 1 - { stdenv, fetchurl, perl, ncurses, xlibsWrapper, bzip2, zlib, openssl 2 - , spidermonkey_1_8_5, gpm 3 - , enableGuile ? false, guile ? null # Incompatible licenses, LGPLv3 - GPLv2 4 - , enablePython ? false, python ? null 1 + { stdenv, fetchurl, ncurses, xlibsWrapper, bzip2, zlib, openssl 2 + , gpm 3 + , # Incompatible licenses, LGPLv3 - GPLv2 4 + enableGuile ? false, guile ? null 5 + , enablePython ? false, python ? null 6 + , enablePerl ? (stdenv.hostPlatform == stdenv.buildPlatform), perl ? null 7 + , enableSpidermonkey ? (stdenv.hostPlatform == stdenv.buildPlatform), spidermonkey_1_8_5 ? null 5 8 }: 6 9 7 10 assert enableGuile -> guile != null; ··· 17 20 18 21 patches = [ ./gc-init.patch ]; 19 22 20 - buildInputs = [ perl ncurses xlibsWrapper bzip2 zlib openssl spidermonkey_1_8_5 gpm ] 23 + buildInputs = [ ncurses xlibsWrapper bzip2 zlib openssl spidermonkey_1_8_5 gpm ] 21 24 ++ stdenv.lib.optional enableGuile guile 22 - ++ stdenv.lib.optional enablePython python; 25 + ++ stdenv.lib.optional enablePython python 26 + ++ stdenv.lib.optional enablePerl perl 27 + ; 23 28 24 - configureFlags = 25 - '' 26 - --enable-finger --enable-html-highlight 27 - --with-perl --enable-gopher --enable-cgi --enable-bittorrent 28 - --with-spidermonkey=${spidermonkey_1_8_5} 29 - --enable-nntp --with-openssl=${openssl.dev} 30 - '' + stdenv.lib.optionalString enableGuile " --with-guile" 31 - + stdenv.lib.optionalString enablePython " --with-python"; 32 - 33 - crossAttrs = { 34 - propagatedBuildInputs = [ ncurses.crossDrv zlib.crossDrv openssl.crossDrv ]; 35 - configureFlags = '' 36 - --enable-finger --enable-html-highlight 37 - --enable-gopher --enable-cgi --enable-bittorrent --enable-nntp 38 - --with-openssl=${openssl.crossDrv} 39 - --with-bzip2=${bzip2.crossDrv} 40 - ''; 41 - }; 29 + configureFlags = [ 30 + "--enable-finger" 31 + "--enable-html-highlight" 32 + "--enable-gopher" 33 + "--enable-cgi" 34 + "--enable-bittorrent" 35 + "--enable-nntp" 36 + "--with-openssl=${openssl.dev}" 37 + "--with-bzip2=${bzip2.dev}" 38 + ] ++ stdenv.lib.optional enableGuile "--with-guile" 39 + ++ stdenv.lib.optional enablePython "--with-python" 40 + ++ stdenv.lib.optional enablePerl "--with-perl" 41 + ++ stdenv.lib.optional enableSpidermonkey "--with-spidermonkey=${spidermonkey_1_8_5}" 42 + ; 42 43 43 44 meta = { 44 45 description = "Full-featured text-mode web browser";
-6
pkgs/applications/networking/browsers/links2/default.nix
··· 30 30 ++ stdenv.lib.optional enableFB "--with-fb" 31 31 ++ stdenv.lib.optional enableDirectFB "--with-directfb"; 32 32 33 - crossAttrs = { 34 - preConfigure = '' 35 - export CC=$crossConfig-gcc 36 - ''; 37 - }; 38 - 39 33 meta = with stdenv.lib; { 40 34 homepage = http://links.twibright.com/; 41 35 description = "A small browser with some graphics support";
+61 -50
pkgs/applications/video/mplayer/default.nix
··· 26 26 , libjpegSupport ? true, libjpeg ? null 27 27 , useUnfreeCodecs ? false 28 28 , darwin ? null 29 - , hostPlatform 29 + , buildPackages 30 30 }: 31 31 32 32 assert fontconfigSupport -> (fontconfig != null); ··· 84 84 meta.license = stdenv.lib.licenses.unfree; 85 85 } else null; 86 86 87 + crossBuild = stdenv.hostPlatform != stdenv.buildPlatform; 88 + 87 89 in 88 90 89 91 stdenv.mkDerivation rec { ··· 100 102 rm -rf ffmpeg 101 103 ''; 102 104 105 + depsBuildBuild = [ buildPackages.stdenv.cc ]; 106 + nativeBuildInputs = [ pkgconfig yasm ]; 103 107 buildInputs = with stdenv.lib; 104 - [ pkgconfig freetype ffmpeg ] 108 + [ freetype ffmpeg ] 105 109 ++ optional aalibSupport aalib 106 110 ++ optional fontconfigSupport fontconfig 107 111 ++ optional fribidiSupport fribidi ··· 129 133 ++ (with darwin.apple_sdk.frameworks; optionals stdenv.isDarwin [ Cocoa OpenGL ]) 130 134 ; 131 135 132 - nativeBuildInputs = [ yasm ]; 136 + configurePlatforms = [ ]; 137 + configureFlags = with stdenv.lib; [ 138 + "--enable-freetype" 139 + (if fontconfigSupport then "--enable-fontconfig" else "--disable-fontconfig") 140 + (if x11Support then "--enable-x11 --enable-gl" else "--disable-x11 --disable-gl") 141 + (if xineramaSupport then "--enable-xinerama" else "--disable-xinerama") 142 + (if xvSupport then "--enable-xv" else "--disable-xv") 143 + (if alsaSupport then "--enable-alsa" else "--disable-alsa") 144 + (if screenSaverSupport then "--enable-xss" else "--disable-xss") 145 + (if vdpauSupport then "--enable-vdpau" else "--disable-vdpau") 146 + (if cddaSupport then "--enable-cdparanoia" else "--disable-cdparanoia") 147 + (if dvdnavSupport then "--enable-dvdnav" else "--disable-dvdnav") 148 + (if bluraySupport then "--enable-bluray" else "--disable-bluray") 149 + (if amrSupport then "--enable-libopencore_amrnb" else "--disable-libopencore_amrnb") 150 + (if cacaSupport then "--enable-caca" else "--disable-caca") 151 + (if lameSupport then "--enable-mp3lame --disable-mp3lame-lavc" else "--disable-mp3lame --enable-mp3lame-lavc") 152 + (if speexSupport then "--enable-speex" else "--disable-speex") 153 + (if theoraSupport then "--enable-theora" else "--disable-theora") 154 + (if x264Support then "--enable-x264 --disable-x264-lavc" else "--disable-x264 --enable-x264-lavc") 155 + (if jackaudioSupport then "" else "--disable-jack") 156 + (if pulseSupport then "--enable-pulse" else "--disable-pulse") 157 + "--disable-xanim" 158 + "--disable-ivtv" 159 + "--disable-xvid --disable-xvid-lavc" 160 + "--disable-ossaudio" 161 + "--disable-ffmpeg_a" 162 + "--yasm=${buildPackages.yasm}/bin/yasm" 163 + # Note, the `target` vs `host` confusion is intensional. 164 + "--target=${stdenv.hostPlatform.config}" 165 + ] ++ optional 166 + (useUnfreeCodecs && codecs != null && !crossBuild) 167 + "--codecsdir=${codecs}" 168 + ++ optional 169 + ((stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64) && !crossBuild) 170 + "--enable-runtime-cpudetection" 171 + ++ optional fribidiSupport "--enable-fribidi" 172 + ++ optional stdenv.isLinux "--enable-vidix" 173 + ++ optional stdenv.isLinux "--enable-fbdev" 174 + ++ optionals (crossBuild) [ 175 + "--enable-cross-compile" 176 + "--disable-vidix-pcidb" 177 + "--with-vidix-drivers=no" 178 + ]; 179 + 180 + preConfigure = '' 181 + configureFlagsArray+=( 182 + "--cc=$CC" 183 + "--host-cc=$BUILD_CC" 184 + "--as=$AS" 185 + "--nm=$NM" 186 + "--ar=$AR" 187 + "--ranlib=$RANLIB" 188 + "--windres=$WINDRES" 189 + ) 190 + ''; 133 191 134 192 postConfigure = '' 135 193 echo CONFIG_MPEGAUDIODSP=yes >> config.mak 136 194 ''; 137 195 138 - configureFlags = with stdenv.lib; 139 - '' 140 - --enable-freetype 141 - ${if fontconfigSupport then "--enable-fontconfig" else "--disable-fontconfig"} 142 - ${if x11Support then "--enable-x11 --enable-gl" else "--disable-x11 --disable-gl"} 143 - ${if xineramaSupport then "--enable-xinerama" else "--disable-xinerama"} 144 - ${if xvSupport then "--enable-xv" else "--disable-xv"} 145 - ${if alsaSupport then "--enable-alsa" else "--disable-alsa"} 146 - ${if screenSaverSupport then "--enable-xss" else "--disable-xss"} 147 - ${if vdpauSupport then "--enable-vdpau" else "--disable-vdpau"} 148 - ${if cddaSupport then "--enable-cdparanoia" else "--disable-cdparanoia"} 149 - ${if dvdnavSupport then "--enable-dvdnav" else "--disable-dvdnav"} 150 - ${if bluraySupport then "--enable-bluray" else "--disable-bluray"} 151 - ${if amrSupport then "--enable-libopencore_amrnb" else "--disable-libopencore_amrnb"} 152 - ${if cacaSupport then "--enable-caca" else "--disable-caca"} 153 - ${if lameSupport then "--enable-mp3lame --disable-mp3lame-lavc" else "--disable-mp3lame --enable-mp3lame-lavc"} 154 - ${if speexSupport then "--enable-speex" else "--disable-speex"} 155 - ${if theoraSupport then "--enable-theora" else "--disable-theora"} 156 - ${if x264Support then "--enable-x264 --disable-x264-lavc" else "--disable-x264 --enable-x264-lavc"} 157 - ${if jackaudioSupport then "" else "--disable-jack"} 158 - ${if pulseSupport then "--enable-pulse" else "--disable-pulse"} 159 - ${optionalString (useUnfreeCodecs && codecs != null) "--codecsdir=${codecs}"} 160 - ${optionalString (stdenv.isi686 || stdenv.isx86_64) "--enable-runtime-cpudetection"} 161 - ${optionalString fribidiSupport "--enable-fribidi"} 162 - --disable-xanim 163 - --disable-ivtv 164 - --disable-xvid --disable-xvid-lavc 165 - ${optionalString stdenv.isLinux "--enable-vidix"} 166 - ${optionalString stdenv.isLinux "--enable-fbdev"} 167 - --disable-ossaudio 168 - --disable-ffmpeg_a 169 - ''; 170 - 171 196 NIX_LDFLAGS = with stdenv.lib; 172 197 optional fontconfigSupport "-lfontconfig" 173 198 ++ optional fribidiSupport "-lfribidi" ··· 187 212 echo "NoDisplay=True" >> $out/share/applications/mplayer.desktop 188 213 fi 189 214 ''; 190 - 191 - crossAttrs = { 192 - configurePlatforms = []; 193 - # Some things (vidix) are nanonote specific. Once someone cares, we can make options from them. 194 - # Note, the `target` vs `host` confusion is intensional. 195 - preConfigure = '' 196 - configureFlags="`echo $configureFlags | 197 - sed -e 's/--codecsdir[^ ]\+//' \ 198 - -e 's/--enable-runtime-cpudetection//' `" 199 - configureFlags="$configureFlags --target=${hostPlatform.arch}-linux 200 - --enable-cross-compile --cc=$crossConfig-gcc --as=$crossConfig-as 201 - --disable-vidix-pcidb --with-vidix-drivers=no --host-cc=gcc" 202 - ''; 203 - }; 204 215 205 216 meta = { 206 217 description = "A movie player that supports many video formats";