Restructure Bookwyrm package expression
This commit is contained in:
parent
e5fffb39a5
commit
d7bb7e08bc
1 changed files with 22 additions and 13 deletions
|
@ -11,7 +11,7 @@ with pkgs . python311Packages ;
|
||||||
with stdenv ;
|
with stdenv ;
|
||||||
|
|
||||||
let
|
let
|
||||||
simplePythonDependencies = [
|
pythonDependencies = [
|
||||||
aiohappyeyeballs
|
aiohappyeyeballs
|
||||||
aiohttp
|
aiohttp
|
||||||
aiosignal
|
aiosignal
|
||||||
|
@ -105,7 +105,7 @@ mkDerivation {
|
||||||
|
|
||||||
# Python dependencies
|
# Python dependencies
|
||||||
|
|
||||||
for dependency in ${ concatStringsSep " " simplePythonDependencies } ; do
|
for dependency in ${ concatStringsSep " " pythonDependencies } ; do
|
||||||
ln -sf $dependency/lib/python3.11/site-packages/* /build/lib/python3.11/site-packages/
|
ln -sf $dependency/lib/python3.11/site-packages/* /build/lib/python3.11/site-packages/
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -127,34 +127,39 @@ mkDerivation {
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p $out/bin
|
|
||||||
mkdir -p $out/lib/python3.11/site-packages
|
|
||||||
mkdir -p $out/srv/http
|
|
||||||
mkdir -p $out/var/lib/bookwyrm
|
|
||||||
|
|
||||||
# Python dependencies
|
|
||||||
|
|
||||||
for dependency in ${ concatStringsSep " " simplePythonDependencies } ; do
|
|
||||||
ln -sf $dependency/lib/python3.11/site-packages/* $out/lib/python3.11/site-packages/
|
|
||||||
done
|
|
||||||
|
|
||||||
# Python packages
|
# Python packages
|
||||||
|
|
||||||
|
mkdir -p $out/lib/python3.11/site-packages
|
||||||
|
|
||||||
|
for dependency in ${ concatStringsSep " " pythonDependencies } ; do
|
||||||
|
ln -sf $dependency/lib/python3.11/site-packages/* $out/lib/python3.11/site-packages/
|
||||||
|
done
|
||||||
|
|
||||||
cp -r /build/source/bookwyrm $out/lib/python3.11/site-packages/
|
cp -r /build/source/bookwyrm $out/lib/python3.11/site-packages/
|
||||||
cp -r /build/source/celerywyrm $out/lib/python3.11/site-packages/
|
cp -r /build/source/celerywyrm $out/lib/python3.11/site-packages/
|
||||||
|
|
||||||
|
|
||||||
# Python scripts
|
# Python scripts
|
||||||
|
|
||||||
cp /build/source/manage.py $out/lib/python3.11/
|
cp /build/source/manage.py $out/lib/python3.11/
|
||||||
|
|
||||||
|
|
||||||
# Static web files
|
# Static web files
|
||||||
|
|
||||||
|
mkdir -p $out/srv/http
|
||||||
|
|
||||||
cp -r /build/source/static/* $out/srv/http/
|
cp -r /build/source/static/* $out/srv/http/
|
||||||
|
|
||||||
ln -s ${source-han-sans}/share/fonts/opentype/source-han-sans/SourceHanSans.ttc $out/srv/http/fonts/source_han_sans/SourceHanSans-VF.ttf.ttc
|
ln -s \
|
||||||
|
${source-han-sans}/share/fonts/opentype/source-han-sans/SourceHanSans.ttc \
|
||||||
|
$out/srv/http/fonts/source_han_sans/SourceHanSans-VF.ttf.ttc
|
||||||
|
|
||||||
|
|
||||||
# Executables
|
# Executables
|
||||||
|
|
||||||
|
mkdir -p $out/bin
|
||||||
|
|
||||||
cat <<- EOF > $out/bin/bookwyrm
|
cat <<- EOF > $out/bin/bookwyrm
|
||||||
#!${bash}/bin/sh
|
#!${bash}/bin/sh
|
||||||
|
|
||||||
|
@ -180,10 +185,14 @@ mkDerivation {
|
||||||
|
|
||||||
chmod +x $out/bin/*
|
chmod +x $out/bin/*
|
||||||
|
|
||||||
|
|
||||||
# Working directory contents
|
# Working directory contents
|
||||||
|
|
||||||
|
mkdir -p $out/var/lib/bookwyrm
|
||||||
|
|
||||||
cp $src/VERSION $out/var/lib/bookwyrm/
|
cp $src/VERSION $out/var/lib/bookwyrm/
|
||||||
|
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'' ;
|
'' ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue