about summary refs log tree commit diff
path: root/nixpkgs/pkgs/misc/cups/drivers/samsung/4.00.39/builder.sh
blob: 829bc6509e069a83bdc27f176a01cd7b5eac8294 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh ]; then . .attrs.sh; fi
source $stdenv/setup

arch=$(uname -m)
echo "$arch" | egrep -q '^i[3456]86$' && arch=i386
echo "Installing for $arch"

unpackPhase
patchPhase

set -v

cd cdroot/Linux
mkdir -p $out/opt
cp -r $arch/at_root/* $out
cp -r $arch/at_opt/* $out/opt
#cp -r noarch/at_root/* $out
cp -r noarch/at_opt/* $out/opt

cd $out
test -d usr/lib64 && ln -s usr/lib64 lib ||
    ln -s usr/lib lib
mkdir -p share/cups
cd share/cups
ln -s ../../opt/share/* .
ln -s ppd model

cd $out/lib/cups/filter
for i in $(ls); do
    echo "Patching $i..."
    patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $i ||
      echo "Couldn't set interpreter!"
    patchelf --set-rpath $cups/lib:$gcc/lib:$glibc/lib $i  # This might not be necessary.
done

ln -s $ghostscript/bin/gs $out/lib/cups/filter