lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 22.05-pre 158 lines 5.6 kB view raw
1{ stdenv, lib, fetchurl, bash, pkg-config, autoconf, cpio, file, which, unzip 2, zip, perl, cups, freetype, alsa-lib, libjpeg, giflib, libpng, zlib, lcms2 3, libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama 4, libXcursor, libXrandr, fontconfig, openjdk14-bootstrap 5, setJavaClassPath 6, headless ? false 7, enableJavaFX ? openjfx.meta.available, openjfx 8, enableGnome2 ? true, gtk3, gnome_vfs, glib, GConf 9}: 10 11let 12 major = "14"; 13 update = ".0.2"; 14 build = "-ga"; 15 16 openjdk = stdenv.mkDerivation rec { 17 pname = "openjdk" + lib.optionalString headless "-headless"; 18 version = "${major}${update}${build}"; 19 20 src = fetchurl { 21 url = "https://hg.openjdk.java.net/jdk-updates/jdk${major}u/archive/jdk-${version}.tar.gz"; 22 sha256 = "1s1pc6ihzf0awp4hbaqfxmbica0hnrg8nr7s0yd2hfn7nan8xmf3"; 23 }; 24 25 nativeBuildInputs = [ pkg-config autoconf unzip ]; 26 buildInputs = [ 27 cpio file which zip perl zlib cups freetype alsa-lib libjpeg giflib 28 libpng zlib lcms2 libX11 libICE libXrender libXext libXtst libXt libXtst 29 libXi libXinerama libXcursor libXrandr fontconfig openjdk14-bootstrap 30 ] ++ lib.optionals (!headless && enableGnome2) [ 31 gtk3 gnome_vfs GConf glib 32 ]; 33 34 patches = [ 35 ./fix-java-home-jdk10.patch 36 ./read-truststore-from-env-jdk10.patch 37 ./currency-date-range-jdk10.patch 38 ./increase-javadoc-heap-jdk13.patch 39 # -Wformat etc. are stricter in newer gccs, per 40 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79677 41 # so grab the work-around from 42 # https://src.fedoraproject.org/rpms/java-openjdk/pull-request/24 43 (fetchurl { 44 url = "https://src.fedoraproject.org/rpms/java-openjdk/raw/06c001c7d87f2e9fe4fedeef2d993bcd5d7afa2a/f/rh1673833-remove_removal_of_wformat_during_test_compilation.patch"; 45 sha256 = "082lmc30x64x583vqq00c8y0wqih3y4r0mp1c4bqq36l22qv6b6r"; 46 }) 47 ] ++ lib.optionals (!headless && enableGnome2) [ 48 ./swing-use-gtk-jdk13.patch 49 ]; 50 51 prePatch = '' 52 chmod +x configure 53 patchShebangs --build configure 54 ''; 55 56 configureFlags = [ 57 "--with-boot-jdk=${openjdk14-bootstrap.home}" 58 "--with-version-pre=" 59 "--enable-unlimited-crypto" 60 "--with-native-debug-symbols=internal" 61 "--with-libjpeg=system" 62 "--with-giflib=system" 63 "--with-libpng=system" 64 "--with-zlib=system" 65 "--with-lcms=system" 66 "--with-stdc++lib=dynamic" 67 ] ++ lib.optional stdenv.isx86_64 "--with-jvm-features=zgc" 68 ++ lib.optional headless "--enable-headless-only" 69 ++ lib.optional (!headless && enableJavaFX) "--with-import-modules=${openjfx}"; 70 71 separateDebugInfo = true; 72 73 NIX_CFLAGS_COMPILE = "-Wno-error"; 74 75 NIX_LDFLAGS = toString (lib.optionals (!headless) [ 76 "-lfontconfig" "-lcups" "-lXinerama" "-lXrandr" "-lmagic" 77 ] ++ lib.optionals (!headless && enableGnome2) [ 78 "-lgtk-3" "-lgio-2.0" "-lgnomevfs-2" "-lgconf-2" 79 ]); 80 81 # -j flag is explicitly rejected by the build system: 82 # Error: 'make -jN' is not supported, use 'make JOBS=N' 83 # Note: it does not make build sequential. Build system 84 # still runs in parallel. 85 enableParallelBuilding = false; 86 87 buildFlags = [ "all" ]; 88 89 installPhase = '' 90 mkdir -p $out/lib 91 92 mv build/*/images/jdk $out/lib/openjdk 93 94 # Remove some broken manpages. 95 rm -rf $out/lib/openjdk/man/ja* 96 97 # Mirror some stuff in top-level. 98 mkdir -p $out/share 99 ln -s $out/lib/openjdk/include $out/include 100 ln -s $out/lib/openjdk/man $out/share/man 101 ln -s $out/lib/openjdk/lib/src.zip $out/lib/src.zip 102 103 # jni.h expects jni_md.h to be in the header search path. 104 ln -s $out/include/linux/*_md.h $out/include/ 105 106 # Remove crap from the installation. 107 rm -rf $out/lib/openjdk/demo 108 ${lib.optionalString headless '' 109 rm $out/lib/openjdk/lib/{libjsound,libfontmanager}.so 110 ''} 111 112 ln -s $out/lib/openjdk/bin $out/bin 113 ''; 114 115 preFixup = '' 116 # Propagate the setJavaClassPath setup hook so that any package 117 # that depends on the JDK has $CLASSPATH set up properly. 118 mkdir -p $out/nix-support 119 #TODO or printWords? cf https://github.com/NixOS/nixpkgs/pull/27427#issuecomment-317293040 120 echo -n "${setJavaClassPath}" > $out/nix-support/propagated-build-inputs 121 122 # Set JAVA_HOME automatically. 123 mkdir -p $out/nix-support 124 cat <<EOF > $out/nix-support/setup-hook 125 if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out/lib/openjdk; fi 126 EOF 127 ''; 128 129 postFixup = '' 130 # Build the set of output library directories to rpath against 131 LIBDIRS="" 132 for output in $outputs; do 133 if [ "$output" = debug ]; then continue; fi 134 LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS" 135 done 136 # Add the local library paths to remove dependencies on the bootstrap 137 for output in $outputs; do 138 if [ "$output" = debug ]; then continue; fi 139 OUTPUTDIR=$(eval echo \$$output) 140 BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) 141 echo "$BINLIBS" | while read i; do 142 patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true 143 patchelf --shrink-rpath "$i" || true 144 done 145 done 146 ''; 147 148 disallowedReferences = [ openjdk14-bootstrap ]; 149 150 meta = import ./meta.nix lib; 151 152 passthru = { 153 architecture = ""; 154 home = "${openjdk}/lib/openjdk"; 155 inherit gtk3; 156 }; 157 }; 158in openjdk