Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions pkgs/applications/radio/pothos/cstring.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Submodule blocks contains modified content
diff --git a/blocks/file/BinaryFileSink.cpp b/blocks/file/BinaryFileSink.cpp
index 31c9a41..0083b0d 100644
--- a/blocks/file/BinaryFileSink.cpp
+++ b/blocks/file/BinaryFileSink.cpp
@@ -13,6 +13,7 @@
#endif //_MSC_VER
#include <stdio.h>
#include <cerrno>
+#include <cstring>

#ifndef O_BINARY
#define O_BINARY 0
diff --git a/blocks/file/BinaryFileSource.cpp b/blocks/file/BinaryFileSource.cpp
index 0151231..379d383 100644
--- a/blocks/file/BinaryFileSource.cpp
+++ b/blocks/file/BinaryFileSource.cpp
@@ -13,6 +13,7 @@
#endif //_MSC_VER
#include <stdio.h>
#include <cerrno>
+#include <cstring>

#ifndef O_BINARY
#define O_BINARY 0
diff --git a/blocks/file/TextFileSink.cpp b/blocks/file/TextFileSink.cpp
index b4b2f08..2be66e2 100644
--- a/blocks/file/TextFileSink.cpp
+++ b/blocks/file/TextFileSink.cpp
@@ -6,6 +6,7 @@
#include <complex>
#include <fstream>
#include <cerrno>
+#include <cstring>

/***********************************************************************
* |PothosDoc Text File Sink
Submodule soapy contains modified content
diff --git a/soapy/DemoController.cpp b/soapy/DemoController.cpp
index 4ce8ead..9a4e742 100644
--- a/soapy/DemoController.cpp
+++ b/soapy/DemoController.cpp
@@ -6,6 +6,7 @@
#include <iostream>
#include <chrono>
#include <algorithm> //min/max
+#include <cstring>

/***********************************************************************
* |PothosDoc SDR Demo Controller
5 changes: 5 additions & 0 deletions pkgs/applications/radio/pothos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ mkDerivation rec {
url = "https://github.com/pothosware/PothosCore/commit/092d1209b0fd0aa8a1733706c994fa95e66fd017.patch";
hash = "sha256-bZXG8kD4+1LgDV8viZrJ/DMjg8UvW7b5keJQDXurfkA=";
})
# various source files are missing imports of <cstring>
./cstring.patch
];

# poco 1.14 requires c++17
NIX_CFLAGS_COMPILE = [ "-std=gnu++17" ];

nativeBuildInputs = [
cmake
pkg-config
Expand Down
37 changes: 37 additions & 0 deletions pkgs/by-name/cr/craftos-pc/fix-poco-header-includes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/src/configuration.cpp b/src/configuration.cpp
index 2196121..0c5cf27 100644
--- a/src/configuration.cpp
+++ b/src/configuration.cpp
@@ -11,6 +11,7 @@
#include <fstream>
#include <unordered_map>
#include <configuration.hpp>
+#include <Poco/JSON/JSONException.h>
#include "platform.hpp"
#include "runtime.hpp"
#include "terminal/SDLTerminal.hpp"
diff --git a/src/main.cpp b/src/main.cpp
index 9ab0814..38976a2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -34,6 +34,7 @@ static void* releaseNotesThread(void* data);
#include <Poco/URI.h>
#include <Poco/Checksum.h>
#include <Poco/JSON/Parser.h>
+#include <Poco/JSON/JSONException.h>
#ifndef __EMSCRIPTEN__
#include <Poco/Net/HTTPSClientSession.h>
#include <Poco/Net/HTTPRequest.h>
diff --git a/src/util.hpp b/src/util.hpp
index b8ab2d1..c643b96 100644
--- a/src/util.hpp
+++ b/src/util.hpp
@@ -21,6 +21,8 @@ extern "C" {
#include <string>
#include <vector>
#include <Poco/JSON/JSON.h>
+#include <Poco/JSON/Object.h>
+#include <Poco/JSON/Array.h>
#include <Poco/JSON/Parser.h>
#include <Poco/Net/HTTPResponse.h>
#include <Computer.hpp>
61 changes: 43 additions & 18 deletions pkgs/by-name/cr/craftos-pc/package.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{ lib
, stdenv
, fetchFromGitHub
, callPackage
, patchelf
, unzip
, poco
, openssl
, SDL2
, SDL2_mixer
, ncurses
, libpng
, pngpp
, libwebp
{
lib,
stdenv,
fetchFromGitHub,
callPackage,
patchelf,
unzip,
poco,
openssl,
SDL2,
SDL2_mixer,
ncurses,
libpng,
pngpp,
libwebp,
}:

let
Expand Down Expand Up @@ -41,8 +42,20 @@ stdenv.mkDerivation rec {
hash = "sha256-DbxAsXxpsa42dF6DaLmgIa+Hs/PPqJ4dE97PoKxG2Ig=";
};

nativeBuildInputs = [ patchelf unzip ];
buildInputs = [ poco openssl SDL2 SDL2_mixer ncurses libpng pngpp libwebp ];
nativeBuildInputs = [
patchelf
unzip
];
buildInputs = [
poco
openssl
SDL2
SDL2_mixer
ncurses
libpng
pngpp
libwebp
];
strictDeps = true;

preBuild = ''
Expand All @@ -57,6 +70,12 @@ stdenv.mkDerivation rec {
runHook postBuild
'';

patches = [
# fix includes of poco headers
# https://github.com/trofi/nixpkgs/pull/5
./fix-poco-header-includes.patch
];

dontStrip = true;

installPhase = ''
Expand Down Expand Up @@ -87,9 +106,15 @@ stdenv.mkDerivation rec {
meta = with lib; {
description = "Implementation of the CraftOS-PC API written in C++ using SDL";
homepage = "https://www.craftos-pc.cc";
license = with licenses; [ mit free ];
license = with licenses; [
mit
free
];
platforms = platforms.linux;
maintainers = with maintainers; [ siraben tomodachi94 ];
maintainers = with maintainers; [
siraben
tomodachi94
];
mainProgram = "craftos";
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt
index d5f3b267d..dfaf99a10 100644
--- a/Foundation/CMakeLists.txt
+++ b/Foundation/CMakeLists.txt
@@ -31,11 +31,13 @@ if(POCO_UNBUNDLED)
find_package(ZLIB REQUIRED)
find_package(Utf8Proc REQUIRED)

- #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library
- POCO_SOURCES(SRCS RegExp
- src/pcre2_ucd.c
- src/pcre2_tables.c
- )
+ if(NOT POCO_STATIC AND BUILD_SHARED_LIBS)
+ #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library
+ POCO_SOURCES(SRCS RegExp
+ src/pcre2_ucd.c
+ src/pcre2_tables.c
+ )
+ endif()

else()
# pcre2
18 changes: 14 additions & 4 deletions pkgs/by-name/po/poco/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@
sqlite,
openssl,
unixODBC,
utf8proc,
libmysqlclient,
}:

stdenv.mkDerivation rec {
pname = "poco";

version = "1.13.3";
version = "1.14.1";

src = fetchFromGitHub {
owner = "pocoproject";
repo = "poco";
sha256 = "sha256-ryBQjzg1DyYd/LBZzjHxq8m/7ZXRSKNNGRkIII0eHK0=";
hash = "sha256-acq2eja61sH/QHwMPmiDNns2jvXRTk0se/tHj9XRSiU=";
rev = "poco-${version}-release";
};

Expand All @@ -32,8 +33,10 @@ stdenv.mkDerivation rec {

buildInputs = [
unixODBC
utf8proc
libmysqlclient
];

propagatedBuildInputs = [
zlib
pcre2
Expand All @@ -50,8 +53,15 @@ stdenv.mkDerivation rec {
MYSQL_DIR = libmysqlclient;
MYSQL_INCLUDE_DIR = "${MYSQL_DIR}/include/mysql";

configureFlags = [
"--unbundled"
cmakeFlags = [
# use nix provided versions of sqlite, zlib, pcre, expat, ... instead of bundled versions
"-DPOCO_UNBUNDLED=ON"
];

patches = [
# poco builds its own version of pcre, disable it for static builds
# https://github.com/pocoproject/poco/issues/4871
./disable-internal-pcre-files-for-static-builds.patch
];

postFixup = ''
Expand Down
Loading