2021-05-31 08:12:09 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
2022-05-08 10:29:54 +02:00
|
|
|
, fetchpatch
|
2021-05-31 08:12:09 +02:00
|
|
|
, pkg-config
|
|
|
|
, wrapGAppsHook
|
|
|
|
, libxml2
|
|
|
|
, gtk
|
|
|
|
, libSM
|
|
|
|
, shared-mime-info
|
|
|
|
}:
|
2016-12-08 11:33:45 +01:00
|
|
|
|
2021-05-31 08:12:09 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rox-filer";
|
2016-12-08 11:33:45 +01:00
|
|
|
version = "2.11";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/rox/rox-filer-${version}.tar.bz2";
|
|
|
|
sha256 = "a929bd32ee18ef7a2ed48b971574574592c42e34ae09f36604bf663d7c101ba8";
|
|
|
|
};
|
|
|
|
|
2021-05-31 08:12:09 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
2019-09-12 16:25:05 +02:00
|
|
|
buildInputs = [ libxml2 gtk shared-mime-info libSM ];
|
2019-10-27 14:03:25 +01:00
|
|
|
NIX_LDFLAGS = "-ldl -lm";
|
2016-12-08 11:33:45 +01:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
./rox-filer-2.11-in-source-build.patch
|
2022-05-08 10:29:54 +02:00
|
|
|
# Pull upstream fix for -fno-common toolchains like upstream gcc-10:
|
|
|
|
# https://github.com/rox-desktop/rox-filer/pull/15
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fno-common.patch";
|
|
|
|
url = "https://github.com/rox-desktop/rox-filer/commit/86b0bb9144186d51ea9b898905111bd8b143b552.patch";
|
|
|
|
sha256 = "1csyx229i09p00lbdlkdqdhn3x2lb5zby1h9rkjgzlr2qz74gc69";
|
|
|
|
})
|
2016-12-08 11:33:45 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
# go to the source directory after unpacking the sources
|
|
|
|
setSourceRoot = "export sourceRoot=rox-filer-${version}/ROX-Filer/";
|
|
|
|
|
2022-05-08 10:29:54 +02:00
|
|
|
# account for 'setSourceRoot' offset
|
|
|
|
patchFlags = [ "-p2" ];
|
2016-12-08 11:33:45 +01:00
|
|
|
|
|
|
|
# patch the main.c to disable the lookup of the APP_DIR environment variable,
|
|
|
|
# which is used to lookup the location for certain images when rox-filer
|
|
|
|
# starts; rather override the location with an absolute path to the directory
|
|
|
|
# where images are stored to prevent having to use a wrapper, which sets the
|
|
|
|
# APP_DIR environment variable prior to starting rox-filer
|
|
|
|
preConfigure = ''
|
|
|
|
sed -i -e "s:g_strdup(getenv(\"APP_DIR\")):\"$out\":" src/main.c
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureScript = "../src/configure";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out"
|
|
|
|
cd ..
|
|
|
|
cp -av Help Messages Options.xml ROX images style.css .DirIcon "$out"
|
|
|
|
|
|
|
|
# create the man/ directory, which will be moved from $out to share/ in the fixup phase
|
|
|
|
mkdir "$out/man/"
|
|
|
|
cp -av ../rox.1 "$out/man/"
|
|
|
|
|
|
|
|
# the main executable
|
|
|
|
mkdir "$out/bin/"
|
|
|
|
cp -v ROX-Filer "$out/bin/rox"
|
|
|
|
|
|
|
|
# mime types
|
|
|
|
mkdir -p "$out/ROX/MIME"
|
|
|
|
cd "$out/ROX/MIME"
|
|
|
|
ln -sv text-x-{diff,patch}.png
|
|
|
|
ln -sv application-x-font-{afm,type1}.png
|
|
|
|
ln -sv application-xml{,-dtd}.png
|
|
|
|
ln -sv application-xml{,-external-parsed-entity}.png
|
|
|
|
ln -sv application-{,rdf+}xml.png
|
|
|
|
ln -sv application-x{ml,-xbel}.png
|
|
|
|
ln -sv application-{x-shell,java}script.png
|
|
|
|
ln -sv application-x-{bzip,xz}-compressed-tar.png
|
|
|
|
ln -sv application-x-{bzip,lzma}-compressed-tar.png
|
|
|
|
ln -sv application-x-{bzip-compressed-tar,lzo}.png
|
|
|
|
ln -sv application-x-{bzip,xz}.png
|
|
|
|
ln -sv application-x-{gzip,lzma}.png
|
|
|
|
ln -sv application-{msword,rtf}.png
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2016-12-08 11:33:45 +01:00
|
|
|
description = "Fast, lightweight, gtk2 file manager";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://rox.sourceforge.net/desktop";
|
2016-12-08 11:33:45 +01:00
|
|
|
license = with licenses; [ gpl2 lgpl2 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.eleanor ];
|
|
|
|
};
|
|
|
|
}
|