at 24.11-pre 1.7 kB view raw
1{ stdenv, fetchurl, undmg, cpio, xar, lib }: 2 3stdenv.mkDerivation rec { 4 pname = "fpc-binary"; 5 version = "3.2.2"; 6 7 src = 8 if stdenv.hostPlatform.system == "i686-linux" then 9 fetchurl { 10 url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.i386-linux.tar"; 11 sha256 = "f62980ac0b2861221f79fdbff67836aa6912a4256d4192cfa4dfa0ac5b419958"; 12 } 13 else if stdenv.hostPlatform.system == "x86_64-linux" then 14 fetchurl { 15 url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.x86_64-linux.tar"; 16 sha256 = "5adac308a5534b6a76446d8311fc340747cbb7edeaacfe6b651493ff3fe31e83"; 17 } 18 else if stdenv.hostPlatform.system == "aarch64-linux" then 19 fetchurl { 20 url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.aarch64-linux.tar"; 21 sha256 = "b39470f9b6b5b82f50fc8680a5da37d2834f2129c65c24c5628a80894d565451"; 22 } 23 else if stdenv.isDarwin then 24 fetchurl { 25 url = "mirror://sourceforge/project/freepascal/Mac%20OS%20X/${version}/fpc-${version}.intelarm64-macosx.dmg"; 26 sha256 = "05d4510c8c887e3c68de20272abf62171aa5b2ef1eba6bce25e4c0bc41ba8b7d"; 27 } 28 else throw "Not supported on ${stdenv.hostPlatform.system}."; 29 30 31 nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ 32 undmg 33 xar 34 cpio 35 ]; 36 37 builder = 38 if stdenv.hostPlatform.isLinux then 39 ./binary-builder.sh 40 else if stdenv.hostPlatform.isDarwin then 41 ./binary-builder-darwin.sh 42 else throw "Not supported on ${stdenv.hostPlatform}."; 43 44 meta = { 45 description = "Free Pascal Compiler from a binary distribution"; 46 }; 47}