init
This commit is contained in:
5
pkgs/default.nix
Normal file
5
pkgs/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
# Custom packages, that can be defined similarly to ones from nixpkgs
|
||||
# You can build them using 'nix build .#example' or (legacy) 'nix-build -A example'
|
||||
{ pkgs ? (import ../nixpkgs.nix) { } }: with pkgs; {
|
||||
# waydroid-script = callPackage ./waydroid-script { };
|
||||
}
|
||||
67
pkgs/waydroid-script/default.nix
Normal file
67
pkgs/waydroid-script/default.nix
Normal file
@@ -0,0 +1,67 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
, python3Packages
|
||||
, fetchFromGitHub
|
||||
, substituteAll
|
||||
, lzip
|
||||
, util-linux
|
||||
, nix-update-script
|
||||
}:
|
||||
let
|
||||
pname = "waydroid-script";
|
||||
version = "unstable-2023-08-25";
|
||||
src = fetchFromGitHub {
|
||||
repo = "waydroid_script";
|
||||
owner = "casualsnek";
|
||||
rev = "77e222fb166c645a18c6a65aba8547631ff17704";
|
||||
hash = "sha256-FstkA6SKqrX0bD4NfyFbPQCLyfHfvWakmiRPmTGo78g=";
|
||||
};
|
||||
|
||||
resetprop = stdenv.mkDerivation {
|
||||
pname = "resetprop";
|
||||
inherit version src;
|
||||
dontBuild = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/share
|
||||
cp -r bin/* $out/share/
|
||||
'';
|
||||
};
|
||||
in python3Packages.buildPythonApplication rec {
|
||||
inherit pname version src;
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
inquirerpy
|
||||
requests
|
||||
tqdm
|
||||
|
||||
lzip
|
||||
util-linux
|
||||
];
|
||||
|
||||
postPatch = let
|
||||
setup = substituteAll {
|
||||
src = ./setup.py;
|
||||
inherit pname;
|
||||
desc = meta.description;
|
||||
version = builtins.replaceStrings [ "-" ] [ "." ]
|
||||
(lib.strings.removePrefix "unstable-" version);
|
||||
};
|
||||
in ''
|
||||
ln -s ${setup} setup.py
|
||||
|
||||
substituteInPlace stuff/general.py \
|
||||
--replace "os.path.dirname(__file__), \"..\", \"bin\"," "\"${resetprop}/share\","
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script {
|
||||
extraArgs = [ "--version=branch" ];
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Python Script to add libraries to waydroid";
|
||||
homepage = "https://github.com/casualsnek/waydroid_script";
|
||||
license = licenses.gpl3;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ ataraxiasjel ];
|
||||
};
|
||||
}
|
||||
16
pkgs/waydroid-script/setup.py
Normal file
16
pkgs/waydroid-script/setup.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name='@pname@',
|
||||
version='@version@',
|
||||
description='@desc@',
|
||||
packages=["main", "stuff", "tools"],
|
||||
python_requires='>=3.8',
|
||||
install_requires = ['tqdm', 'requests', 'InquirerPy'],
|
||||
package_dir = {
|
||||
'main': '.',
|
||||
},
|
||||
entry_points = {
|
||||
'console_scripts': ['waydroid-script=main.main:main'],
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user