Initial commit
This commit is contained in:
59
derivations/ddt4all.nix
Normal file
59
derivations/ddt4all.nix
Normal file
@ -0,0 +1,59 @@
|
||||
{ mkDerivation,
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
python3,
|
||||
qtbase,
|
||||
qttools,
|
||||
wrapQtAppsHook,
|
||||
git,
|
||||
which,
|
||||
}:
|
||||
let
|
||||
myPython = python3.withPackages (pkgs: with pkgs; [ pyqt5 pyqtwebengine pyusb crcmod pyserial ]);
|
||||
in
|
||||
mkDerivation rec {
|
||||
pname = "ddt4all";
|
||||
version = "1.0.0"; # Replace with the actual version if necessary
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "cedricp";
|
||||
repo = "ddt4all";
|
||||
rev = "master";
|
||||
sha256 = "sha256-EX7cobgxM8/o4cRmfMMDSYG9X9Av6zmoWlSv1nzfl5o=";
|
||||
};
|
||||
|
||||
# If necessary, add patches to the source
|
||||
# patches = [ ./some_patch.patch ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
myPython
|
||||
wrapQtAppsHook # This is useful for Qt apps
|
||||
qttools # Required for Qt applications
|
||||
which # For locating binaries (e.g., python3)
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
myPython
|
||||
qtbase
|
||||
qttools
|
||||
];
|
||||
|
||||
#makeFlags = [ "PREFIX=$(out)" ];
|
||||
runScript = ''
|
||||
# Set up environment for running the app
|
||||
export LD_LIBRARY_PATH=${qtbase}/lib:${myPython}/lib:$LD_LIBRARY_PATH
|
||||
|
||||
if [ ! -d ".venv" ]; then
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
else
|
||||
source .venv/bin/activate
|
||||
fi
|
||||
|
||||
# Run the application
|
||||
python3 main.py
|
||||
'';
|
||||
}
|
Reference in New Issue
Block a user