-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate .deb package from build #15
base: master
Are you sure you want to change the base?
Changes from all commits
0ebbfc0
a0214e0
122fa64
7dac290
df6c289
4b0fce8
e3f5ce9
617b13f
e26ca5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,8 @@ cmake_install.cmake | |
|
||
# vcpkg | ||
vcpkg_installed/ | ||
|
||
# debian packaging | ||
*.deb | ||
deb/opt | ||
deb/usr |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@PACKAGE_INIT@ | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}Targets.cmake") | ||
|
||
check_required_components(${PROJECT_NAME}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Package: libaedile | ||
Version: 0.0.2 | ||
Maintainer: MichaelJ | ||
Architecture: amd64 | ||
Description: Plug-and-play Nostr Development Kit | ||
Pre-Depends: dpkg ( >= 1.16.1), libwebsocketpp-dev ( >= 0.8.1-7), nlohmann-json3-dev ( >= 3.7.3-1), libssl-dev ( >= 3.0), libplog-dev ( >= 1.1.10) |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems to be in dos format, needed to convert to unix line endings before running on Debian. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like your probably right. Pulled a clean version and ran dos2unix then |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#! /bin/bash | ||
|
||
export PACKAGE_NAME="libaedile-dev" | ||
export VERSION="0.0.2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we be centralizing the build version somehow so we don't need to remember to increment versions at every location? Or will this be the entry-point for the entire package? I assume some users will be building from cmake directly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now, this is a util script. Ideally, the build will be done on a jenkins job, and there we can set these variables as env variables for the job. |
||
|
||
export SRC_ROOT_DIR=$(dirname $(readlink -f ${0})) | ||
export DEB_PACKAGE_ROOT="${SRC_ROOT_DIR}/deb" | ||
export INSTALL_DIR="${DEB_PACKAGE_ROOT}/opt/${PACKAGE_NAME}/usr" | ||
|
||
|
||
rm -rf $INSTALL_DIR | ||
mkdir -p $INSTALL_DIR | ||
|
||
cd "${SRC_ROOT_DIR}" | ||
cmake --preset=linux | ||
cmake --build build/linux | ||
cmake --install build/linux | ||
|
||
rm -rf ${DEB_PACKAGE_ROOT}/usr/ | ||
|
||
mkdir -p ${DEB_PACKAGE_ROOT}/usr/include/aedile/client | ||
mkdir -p ${DEB_PACKAGE_ROOT}/usr/lib | ||
|
||
ln -s ${INSTALL_DIR}/include/nostr.h ${DEB_PACKAGE_ROOT}/usr/include/aedile/nostr.h | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we adding this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like we ditched it between master and note_signing. It probably shouldn't exist as it just does some C++ header imports.
Edit: I'm retarded, it was added below. I'll wait for explanation :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do need to get note_signing up to speed and merge it into master, it's been divergent from master for too long at this point. My guess is that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It made me realize we need to prune up some of our public api headers too. I don't think they need to be including all the headers listed at the moment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we will eventually have just a |
||
ln -s ${INSTALL_DIR}/include/nostr.hpp ${DEB_PACKAGE_ROOT}/usr/include/aedile/nostr.hpp | ||
ln -s ${INSTALL_DIR}/include/client/web_socket_client.hpp ${DEB_PACKAGE_ROOT}/usr/include/aedile/client/web_socket_client.hpp | ||
ln -s ${INSTALL_DIR}/lib/libaedile.a ${DEB_PACKAGE_ROOT}/usr/lib/libaedile.a | ||
|
||
cd "${SRC_ROOT_DIR}" | ||
|
||
dpkg-deb --build deb deb/$PACKAGE_NAME-${VERSION}.deb |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include <nostr.hpp> | ||
#include <client/web_socket_client.hpp> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include "web_socket_client.hpp" | ||
#include <unordered_map> | ||
|
||
using std::error_code; | ||
using std::function; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#======== Build the tests ========# | ||
enable_testing() | ||
include(GoogleTest) | ||
|
||
FetchContent_Declare( | ||
googletest | ||
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip | ||
) | ||
|
||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
FetchContent_MakeAvailable(googletest) | ||
|
||
enable_testing() | ||
|
||
set(TEST_DIR ./) | ||
set(TEST_SOURCES | ||
${TEST_DIR}/nostr_service_test.cpp | ||
) | ||
|
||
add_executable(aedile_test ${TEST_SOURCES} ${HEADERS}) | ||
target_link_libraries(aedile_test PRIVATE | ||
GTest::gmock | ||
GTest::gtest | ||
GTest::gtest_main | ||
aedile | ||
plog::plog | ||
websocketpp::websocketpp | ||
) | ||
target_include_directories(aedile_test PUBLIC ${INCLUDE_DIR}) | ||
set_target_properties(aedile_test PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS YES) | ||
|
||
gtest_add_tests(TARGET aedile_test) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what the
BUILD_INTERFACE
part means here?