diff options
Diffstat (limited to 'pkgs/development/compilers/fpc')
-rwxr-xr-x | pkgs/development/compilers/fpc/binary-builder-darwin.sh | 18 | ||||
-rwxr-xr-x | pkgs/development/compilers/fpc/binary-builder.sh | 15 | ||||
-rw-r--r-- | pkgs/development/compilers/fpc/binary.nix | 47 | ||||
-rw-r--r-- | pkgs/development/compilers/fpc/default.nix | 80 | ||||
-rw-r--r-- | pkgs/development/compilers/fpc/lazarus.nix | 111 | ||||
-rw-r--r-- | pkgs/development/compilers/fpc/libqt5pas.nix | 24 | ||||
-rw-r--r-- | pkgs/development/compilers/fpc/mark-paths.patch | 109 | ||||
-rwxr-xr-x | pkgs/development/compilers/fpc/remove-signature.sh | 3 |
8 files changed, 0 insertions, 407 deletions
diff --git a/pkgs/development/compilers/fpc/binary-builder-darwin.sh b/pkgs/development/compilers/fpc/binary-builder-darwin.sh deleted file mode 100755 index 8a8600f1f639..000000000000 --- a/pkgs/development/compilers/fpc/binary-builder-darwin.sh +++ /dev/null @@ -1,18 +0,0 @@ -if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh ]; then . .attrs.sh; fi -source $stdenv/setup - -pkgdir=$(pwd)/pkg -deploydir=$(pwd)/deploy - -undmg $src -mkdir $out -mkdir $pkgdir -mkdir $deploydir - -pkg=*.mpkg/Contents/Packages/*.pkg -xar -xf $pkg -C $pkgdir -pushd $deploydir -cat $pkgdir/Payload | gunzip -dc | cpio -i -popd -echo $deploydir -cp -r $deploydir/usr/local/* $out diff --git a/pkgs/development/compilers/fpc/binary-builder.sh b/pkgs/development/compilers/fpc/binary-builder.sh deleted file mode 100755 index 568c3094107a..000000000000 --- a/pkgs/development/compilers/fpc/binary-builder.sh +++ /dev/null @@ -1,15 +0,0 @@ -if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh ]; then . .attrs.sh; fi -source $stdenv/setup - -tar xf $src -cd */ -tarballdir=$(pwd) -for i in *.tar; do tar xvf $i; done -echo "Deploying binaries.." -mkdir $out -cd $out -for i in $tarballdir/*.gz; do tar xvf $i; done -echo 'Creating ppc* symlink..' -for i in $out/lib/fpc/*/ppc*; do - ln -fs $i $out/bin/$(basename $i) -done diff --git a/pkgs/development/compilers/fpc/binary.nix b/pkgs/development/compilers/fpc/binary.nix deleted file mode 100644 index e4c8a2358fc8..000000000000 --- a/pkgs/development/compilers/fpc/binary.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ stdenv, fetchurl, undmg, cpio, xar, lib }: - -stdenv.mkDerivation rec { - pname = "fpc-binary"; - version = "3.2.2"; - - src = - if stdenv.hostPlatform.system == "i686-linux" then - fetchurl { - url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.i386-linux.tar"; - sha256 = "f62980ac0b2861221f79fdbff67836aa6912a4256d4192cfa4dfa0ac5b419958"; - } - else if stdenv.hostPlatform.system == "x86_64-linux" then - fetchurl { - url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.x86_64-linux.tar"; - sha256 = "5adac308a5534b6a76446d8311fc340747cbb7edeaacfe6b651493ff3fe31e83"; - } - else if stdenv.hostPlatform.system == "aarch64-linux" then - fetchurl { - url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.aarch64-linux.tar"; - sha256 = "b39470f9b6b5b82f50fc8680a5da37d2834f2129c65c24c5628a80894d565451"; - } - else if stdenv.isDarwin then - fetchurl { - url = "mirror://sourceforge/project/freepascal/Mac%20OS%20X/${version}/fpc-${version}.intelarm64-macosx.dmg"; - sha256 = "05d4510c8c887e3c68de20272abf62171aa5b2ef1eba6bce25e4c0bc41ba8b7d"; - } - else throw "Not supported on ${stdenv.hostPlatform.system}."; - - - nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ - undmg - xar - cpio - ]; - - builder = - if stdenv.hostPlatform.isLinux then - ./binary-builder.sh - else if stdenv.hostPlatform.isDarwin then - ./binary-builder-darwin.sh - else throw "Not supported on ${stdenv.hostPlatform}."; - - meta = { - description = "Free Pascal Compiler from a binary distribution"; - }; -} diff --git a/pkgs/development/compilers/fpc/default.nix b/pkgs/development/compilers/fpc/default.nix deleted file mode 100644 index 3c9eb60d57c7..000000000000 --- a/pkgs/development/compilers/fpc/default.nix +++ /dev/null @@ -1,80 +0,0 @@ -{ lib, stdenv, fetchurl, gawk, fetchpatch, undmg, cpio, xar, darwin, libiconv }: - -let startFPC = import ./binary.nix { inherit stdenv fetchurl undmg cpio xar lib; }; in - -stdenv.mkDerivation rec { - version = "3.2.2"; - pname = "fpc"; - - src = fetchurl { - url = "mirror://sourceforge/freepascal/fpcbuild-${version}.tar.gz"; - sha256 = "85ef993043bb83f999e2212f1bca766eb71f6f973d362e2290475dbaaf50161f"; - }; - - buildInputs = [ startFPC gawk ] - ++ lib.optionals stdenv.isDarwin [ - libiconv - darwin.apple_sdk.frameworks.CoreFoundation - ]; - - glibc = stdenv.cc.libc.out; - - # Patch paths for linux systems. Other platforms will need their own patches. - patches = [ - ./mark-paths.patch # mark paths for later substitution in postPatch - ] ++ lib.optional stdenv.isAarch64 (fetchpatch { - # backport upstream patch for aarch64 glibc 2.34 - url = "https://gitlab.com/freepascal.org/fpc/source/-/commit/a20a7e3497bccf3415bf47ccc55f133eb9d6d6a0.patch"; - hash = "sha256-xKTBwuOxOwX9KCazQbBNLhMXCqkuJgIFvlXewHY63GM="; - stripLen = 1; - extraPrefix = "fpcsrc/"; - }); - - postPatch = '' - # substitute the markers set by the mark-paths patch - substituteInPlace fpcsrc/compiler/systems/t_linux.pas --subst-var-by dynlinker-prefix "${glibc}" - substituteInPlace fpcsrc/compiler/systems/t_linux.pas --subst-var-by syslibpath "${glibc}/lib" - # Replace the `codesign --remove-signature` command with a custom script, since `codesign` is not available - # in nixpkgs - # Remove the -no_uuid strip flag which does not work on llvm-strip, only - # Apple strip. - substituteInPlace fpcsrc/compiler/Makefile \ - --replace \ - "\$(CODESIGN) --remove-signature" \ - "${./remove-signature.sh}" \ - --replace "ifneq (\$(CODESIGN),)" "ifeq (\$(OS_TARGET), darwin)" \ - --replace "-no_uuid" "" - ''; - - NIX_LDFLAGS = lib.optionalString - stdenv.isDarwin (with darwin.apple_sdk.frameworks; "-F${CoreFoundation}/Library/Frameworks"); - - makeFlags = [ "NOGDB=1" "FPC=${startFPC}/bin/fpc" ]; - - installFlags = [ "INSTALL_PREFIX=\${out}" ]; - - postInstall = '' - for i in $out/lib/fpc/*/ppc*; do - ln -fs $i $out/bin/$(basename $i) - done - mkdir -p $out/lib/fpc/etc/ - $out/lib/fpc/*/samplecfg $out/lib/fpc/${version} $out/lib/fpc/etc/ - - # Generate config files in /etc since on darwin, ppc* does not follow symlinks - # to resolve the location of /etc - mkdir -p $out/etc - $out/lib/fpc/*/samplecfg $out/lib/fpc/${version} $out/etc - ''; - - passthru = { - bootstrap = startFPC; - }; - - meta = with lib; { - description = "Free Pascal Compiler from a source distribution"; - homepage = "https://www.freepascal.org"; - maintainers = [ maintainers.raskin ]; - license = with licenses; [ gpl2 lgpl2 ]; - platforms = platforms.unix; - }; -} diff --git a/pkgs/development/compilers/fpc/lazarus.nix b/pkgs/development/compilers/fpc/lazarus.nix deleted file mode 100644 index ba2eeada5e46..000000000000 --- a/pkgs/development/compilers/fpc/lazarus.nix +++ /dev/null @@ -1,111 +0,0 @@ -{ stdenv, lib, fetchurl, makeWrapper, writeText -, fpc, gtk2, glib, pango, atk, gdk-pixbuf -, libXi, xorgproto, libX11, libXext -, gdb, gnumake, binutils -, withQt ? false, qtbase ? null, libqt5pas ? null, wrapQtAppsHook ? null -}: - -# TODO: -# 1. the build date is embedded in the binary through `$I %DATE%` - we should dump that - -let - version = "3.2-0"; - - # as of 2.0.10 a suffix is being added. That may or may not disappear and then - # come back, so just leave this here. - majorMinorPatch = v: - builtins.concatStringsSep "." (lib.take 2 (lib.splitVersion v)); - - overrides = writeText "revision.inc" (lib.concatStringsSep "\n" (lib.mapAttrsToList (k: v: - "const ${k} = '${v}';") { - # this is technically the SVN revision but as we don't have that replace - # it with the version instead of showing "Unknown" - RevisionStr = version; - })); - -in -stdenv.mkDerivation rec { - pname = "lazarus-${LCL_PLATFORM}"; - inherit version; - - src = fetchurl { - url = "mirror://sourceforge/lazarus/Lazarus%20Zip%20_%20GZip/Lazarus%20${majorMinorPatch version}/lazarus-${version}.tar.gz"; - sha256 = "69f43f0a10b9e09deea5f35094c73b84464b82d3f40d8a2fcfcb5a5ab03c6edf"; - }; - - postPatch = '' - cp ${overrides} ide/${overrides.name} - ''; - - buildInputs = [ - # we need gtk2 unconditionally as that is the default target when building applications with lazarus - fpc gtk2 glib libXi xorgproto - libX11 libXext pango atk - stdenv.cc gdk-pixbuf - ] - ++ lib.optionals withQt [ libqt5pas qtbase ]; - - # Disable parallel build, errors: - # Fatal: (1018) Compilation aborted - enableParallelBuilding = false; - - nativeBuildInputs = [ - makeWrapper - ] ++ lib.optional withQt wrapQtAppsHook; - - makeFlags = [ - "FPC=fpc" - "PP=fpc" - "LAZARUS_INSTALL_DIR=${placeholder "out"}/share/lazarus/" - "INSTALL_PREFIX=${placeholder "out"}/" - "REQUIRE_PACKAGES+=tachartlazaruspkg" - "bigide" - ]; - - LCL_PLATFORM = if withQt then "qt5" else "gtk2"; - - NIX_LDFLAGS = lib.concatStringsSep " " ([ - "-L${stdenv.cc.cc.lib}/lib" - "-lX11" - "-lXext" - "-lXi" - "-latk-1.0" - "-lc" - "-lcairo" - "-lgcc_s" - "-lgdk-x11-2.0" - "-lgdk_pixbuf-2.0" - "-lglib-2.0" - "-lgtk-x11-2.0" - "-lpango-1.0" - ] - ++ lib.optionals withQt [ - "-L${lib.getLib libqt5pas}/lib" - "-lQt5Pas" - ]); - - preBuild = '' - mkdir -p $out/share "$out/lazarus" - tar xf ${fpc.src} --strip-components=1 -C $out/share -m - substituteInPlace ide/packages/ideconfig/include/unix/lazbaseconf.inc \ - --replace '/usr/fpcsrc' "$out/share/fpcsrc" - ''; - - postInstall = let - ldFlags = ''$(echo "$NIX_LDFLAGS" | sed -re 's/-rpath [^ ]+//g')''; - in '' - wrapProgram $out/bin/startlazarus \ - --prefix NIX_LDFLAGS ' ' "${ldFlags}" \ - --prefix NIX_LDFLAGS_${binutils.suffixSalt} ' ' "${ldFlags}" \ - --prefix LCL_PLATFORM ' ' "$LCL_PLATFORM" \ - --prefix PATH ':' "${lib.makeBinPath [ fpc gdb gnumake binutils ]}" - ''; - - meta = with lib; { - description = "Graphical IDE for the FreePascal language"; - homepage = "https://www.lazarus.freepascal.org"; - license = licenses.gpl2Plus ; - maintainers = with maintainers; [ raskin ]; - platforms = platforms.linux; - }; -} diff --git a/pkgs/development/compilers/fpc/libqt5pas.nix b/pkgs/development/compilers/fpc/libqt5pas.nix deleted file mode 100644 index f3ddfe9edc23..000000000000 --- a/pkgs/development/compilers/fpc/libqt5pas.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ mkDerivation, lib, lazarus, qmake, qtbase, qtx11extras }: - -mkDerivation { - pname = "libqt5pas"; - inherit (lazarus) version src; - - sourceRoot = "lazarus/lcl/interfaces/qt5/cbindings"; - - postPatch = '' - substituteInPlace Qt5Pas.pro \ - --replace 'target.path = $$[QT_INSTALL_LIBS]' "target.path = $out/lib" - ''; - - nativeBuildInputs = [ qmake ]; - - buildInputs = [ qtbase qtx11extras ]; - - meta = with lib; { - description = "Free Pascal Qt5 binding library"; - homepage = "https://wiki.freepascal.org/Qt5_Interface#libqt5pas"; - maintainers = with maintainers; [ sikmir ]; - inherit (lazarus.meta) license platforms; - }; -} diff --git a/pkgs/development/compilers/fpc/mark-paths.patch b/pkgs/development/compilers/fpc/mark-paths.patch deleted file mode 100644 index 145339fe41ce..000000000000 --- a/pkgs/development/compilers/fpc/mark-paths.patch +++ /dev/null @@ -1,109 +0,0 @@ -diff --git a/fpcsrc/compiler/systems/t_linux.pas b/fpcsrc/compiler/systems/t_linux.pas -index a7398fb9..8e46fec0 100644 ---- a/fpcsrc/compiler/systems/t_linux.pas -+++ b/fpcsrc/compiler/systems/t_linux.pas -@@ -135,13 +135,13 @@ begin - LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib64',true); - { /lib64 should be the really first, so add it before everything else } - LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib',true); -- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64',true); -+ LibrarySearchPath.AddLibraryPath(sysrootpath,'=@syslibpath@',true); - {$else} - {$ifdef powerpc64} - if target_info.abi<>abi_powerpc_elfv2 then -- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64;=/usr/lib64;=/usr/X11R6/lib64',true) -+ LibrarySearchPath.AddLibraryPath(sysrootpath,'=/@syslibpath@;=/usr/lib64;=/usr/X11R6/lib64',true) - else -- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64;=/usr/lib/powerpc64le-linux-gnu;=/usr/X11R6/powerpc64le-linux-gnu',true); -+ LibrarySearchPath.AddLibraryPath(sysrootpath,'=/@syslibpath@;=/usr/lib/powerpc64le-linux-gnu;=/usr/X11R6/powerpc64le-linux-gnu',true); - {$else powerpc64} - LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib;=/usr/lib;=/usr/X11R6/lib',true); - {$endif powerpc64} -@@ -165,7 +165,7 @@ begin - {$endif i386} - {$ifdef aarch64} - LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib64',true); -- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib/aarch64-linux-gnu',true); -+ LibrarySearchPath.AddLibraryPath(sysrootpath,'=@syslibpath@',true); - {$endif aarch64} - {$ifdef powerpc} - LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib/powerpc-linux-gnu',true); -@@ -186,53 +186,53 @@ begin - end; - - {$ifdef m68k} -- const defdynlinker='/lib/ld.so.1'; -+ const defdynlinker='@dynlinker-prefix@/lib/ld.so.1'; - {$endif m68k} - - {$ifdef i386} -- const defdynlinker='/lib/ld-linux.so.2'; -+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2'; - {$endif} - - {$ifdef x86_64} -- const defdynlinker='/lib64/ld-linux-x86-64.so.2'; -+ const defdynlinker='@dynlinker-prefix@/lib64/ld-linux-x86-64.so.2'; - {$endif x86_64} - - {$ifdef sparc} -- const defdynlinker='/lib/ld-linux.so.2'; -+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2'; - {$endif sparc} - - {$ifdef powerpc} -- const defdynlinker='/lib/ld.so.1'; -+ const defdynlinker='@dynlinker-prefix@/lib/ld.so.1'; - {$endif powerpc} - - {$ifdef powerpc64} -- const defdynlinkerv1='/lib64/ld64.so.1'; -- const defdynlinkerv2='/lib64/ld64.so.2'; -+ const defdynlinkerv1='@dynlinker-prefix@/lib64/ld64.so.1'; -+ const defdynlinkerv2='@dynlinker-prefix@/lib64/ld64.so.2'; - var defdynlinker: string; - {$endif powerpc64} - - {$ifdef arm} - {$ifdef FPC_ARMHF} -- const defdynlinker='/lib/ld-linux-armhf.so.3'; -+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux-armhf.so.3'; - {$else FPC_ARMHF} - {$ifdef FPC_ARMEL} -- const defdynlinker='/lib/ld-linux.so.3'; -+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.3'; - {$else FPC_ARMEL} -- const defdynlinker='/lib/ld-linux.so.2'; -+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2'; - {$endif FPC_ARMEL} - {$endif FPC_ARMHF} - {$endif arm} - - {$ifdef aarch64} --const defdynlinker='/lib/ld-linux-aarch64.so.1'; -+const defdynlinker='@dynlinker-prefix@/lib/ld-linux-aarch64.so.1'; - {$endif aarch64} - - {$ifdef mips} -- const defdynlinker='/lib/ld.so.1'; -+ const defdynlinker='@dynlinker-prefix@/lib/ld.so.1'; - {$endif mips} - - {$ifdef sparc64} -- const defdynlinker='/lib64/ld-linux.so.2'; -+ const defdynlinker='@dynlinker-prefix@/lib64/ld-linux.so.2'; - {$endif sparc64} - - -@@ -267,9 +267,9 @@ begin - libctype:=uclibc; - end - {$ifdef i386} -- else if FileExists(sysrootpath+'/lib/ld-linux.so.1',false) then -+ else if FileExists(sysrootpath+'@dynlinker-prefix@/lib/ld-linux.so.1',false) then - begin -- DynamicLinker:='/lib/ld-linux.so.1'; -+ DynamicLinker:='@dynlinker-prefix@/lib/ld-linux.so.1'; - libctype:=glibc2; - end - {$endif i386} diff --git a/pkgs/development/compilers/fpc/remove-signature.sh b/pkgs/development/compilers/fpc/remove-signature.sh deleted file mode 100755 index 9fed8ab057ce..000000000000 --- a/pkgs/development/compilers/fpc/remove-signature.sh +++ /dev/null @@ -1,3 +0,0 @@ -source $stdenv/setup - -codesign_allocate -r -i "$1" -o "$1" |