package.nix (1930B)
1 { 2 lib, 3 stdenv, 4 fetchurl, 5 6 bison, 7 gettext, 8 pkg-config, 9 10 firebird, 11 gd, 12 libmysqlclient, 13 libpq, 14 libz, 15 net-snmp, 16 pcre, 17 portaudio, 18 qt6, 19 sqlite, 20 21 withFireBird ? false, 22 withMySQL ? false, 23 withPostgreSQL ? false, 24 withSNMP ? false, 25 withSoundCard ? false, 26 }: 27 28 stdenv.mkDerivation (finalAttrs: { 29 pname = "openscada"; 30 version = "0.9.8"; 31 32 main_src = fetchurl { 33 url = "http://oscada.org/oscadaArch/0.9/openscada-${finalAttrs.version}.tar.xz"; 34 hash = "sha256-UuDdURwu/hL/b3sykumLbHZXMzLh8/qmKqEsBRcaZew="; 35 }; 36 37 res_src = fetchurl { 38 url = "http://oscada.org/oscadaArch/0.9/openscada-res-${finalAttrs.version}.tar.xz"; 39 hash = "sha256-qVCmklGt9UKGFC1iiSy9+4kqfScfNIoiJeXX60bjJr0="; 40 }; 41 42 srcs = [ 43 finalAttrs.main_src 44 finalAttrs.res_src 45 ]; 46 47 sourceRoot = "openscada-${finalAttrs.version}"; 48 49 postPatch = '' 50 mv ../data ../doc . 51 ''; 52 53 nativeBuildInputs = [ 54 bison 55 gettext 56 pkg-config 57 qt6.wrapQtAppsHook 58 ]; 59 60 buildInputs = [ 61 gd 62 libz 63 pcre 64 qt6.qtbase 65 sqlite 66 ] 67 ++ lib.optional withFireBird firebird 68 ++ lib.optional withMySQL libmysqlclient 69 ++ lib.optional withPostgreSQL libpq 70 ++ lib.optional withSNMP net-snmp 71 ++ lib.optional withSoundCard portaudio; 72 73 configureFlags = [ 74 (lib.enableFeature withFireBird "FireBird") 75 (lib.withFeatureAs withFireBird "firebird" firebird) 76 (lib.enableFeature withMySQL "MySQL") 77 (lib.enableFeature withPostgreSQL "PostgreSQL") 78 (lib.enableFeature withSNMP "SNMP") 79 (lib.enableFeature withSoundCard "SoundCard") 80 ]; 81 82 enableParallelBuilding = true; 83 84 env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; 85 86 meta = { 87 description = "Open SCADA system"; 88 homepage = "http://oscada.org"; 89 license = lib.licenses.gpl2Only; 90 maintainers = [ lib.maintainers.sikmir ]; 91 platforms = lib.platforms.unix; 92 mainProgram = "openscada"; 93 }; 94 })
