Skip to content

Commit

Permalink
0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
realbardia committed Jul 20, 2023
1 parent 71d9170 commit 3f3b6de
Show file tree
Hide file tree
Showing 28 changed files with 1,077 additions and 41 deletions.
183 changes: 142 additions & 41 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,54 +1,155 @@
# C++ objects and libs
*.slo
*.lo
*.o
# This file is used to ignore files which are generated in the Qt build system
# ----------------------------------------------------------------------------

# Specific files/paths

# qmake/configure stuff
/.qmake.cache
/.qmake.stash

/mkspecs/modules/qt_*.pri
/mkspecs/modules-inst/

/include/

/lib/*
!/lib/README

/doc/*.qch
/doc/activeqt
/doc/qdoc
/doc/qmake
/doc/qt*/*

/translations/*.qm
/translations/*_en.ts
/translations/*_untranslated.ts

# Unit tests libs/plugins/data
/tests/auto/cmake/build/
/build

QObject.log
tst_*
!tst_*.*
tst_*.log
tst_*.debug
tst_*~

# Generic directories
.metadata/
.pc/
debug/
release/
tmp/
tmp-debug/
tmp-debug-shared/
tmp-release/
tmp-release-shared/
qtc-qmldump/
qtc-qmldbg/
*.app/
*.d/

# Generic files
.#*
.com.apple.timemachine.supported
.DS_Store
callgrind.out.*
core
Makefile*
!/qmake/Makefile.win32*
!/qmake/Makefile.unix
object_script.*
pcviewer.cfg
tags
*~
*.a
*.la
*.lai
*.so
*.so.*
*.core
*.dll
*.exe
*.dylib
*.gcov
*.gcda
*.gcno
*.lib
!Info.plist.lib
*.o
*.obj
*.orig
*.swp
*.rej
*.so
*.so.*
*.pbxuser
*.mode1
*.mode1v3
*_resource.rc
*.*#
*.debug

# Qt-es
object_script.*.Release
object_script.*.Debug
*_plugin_import.cpp
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.moc
# xemacs temporary files
*.flc

# Vim temporary files
.*.swp

# Visual Studio generated files
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.ncb
*.vcxproj
*.vcxproj.filters
*.vcxproj.user
*.exe.embed.manifest
*.exe_manifest.rc
*.exe_manifest.res
*.appxmanifest
.qmake.winrt_uuid_*

# INTEGRITY generated files
*.ael
*.dla
*.dnm
*.dep
*.map

# Precompiled headers
*.gch
*.pchi
*.pchi.cpp
*_pch.obj
*_pch.pch

# Qt-specific files
codeattributions.qdoc
moc_*.cpp
moc_*.h
qrc_*.cpp
ui_*.h
*.qmlc
*.jsc
Makefile*
*build-*
*.qm
*.moc
*.prl
*.pro.user*
*.qmlproject.user*
*.rcc

# Qt unit tests
target_wrapper.*
# Generated by qt_module.prf
*.version
*.version.in

# QtCreator
*.autosave
# Generated by qtPrepareTool()
wrapper.sh
wrapper.bat
*_wrapper.sh
*_wrapper.bat

# QtCreator Qml
*.qmlproject.user
*.qmlproject.user.*
# Generated by dbusxml2cpp
*_interface.*
*_adaptor.*

# QtCreator CMake
CMakeLists.txt.user*

# QtCreator 4.8< compilation database
compile_commands.json

# QtCreator local machine specific files for imported projects
*creator.user*

*_qmlcache.qrc
# Generated by qt.prf
*_plugin_import.cpp
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/thirdparty/secp256k1"]
path = src/thirdparty/secp256k1
url = https://github.com/bitcoin-core/secp256k1
3 changes: 3 additions & 0 deletions .qmake.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
load(qt_build_config)

MODULE_VERSION = 0.1.0
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generated from qthttpserver.pro.

cmake_minimum_required(VERSION 3.15.0)

project(QNostr
VERSION 6.0.0
DESCRIPTION "Qt Nostr Client"
HOMEPAGE_URL "https://aseman.io/"
LANGUAGES CXX C
)

find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core Network WebSockets)
find_package(OpenSSL REQUIRED)

qt_build_repo()
5 changes: 5 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Generated from examples.pro.

qt_examples_build_begin()

qt_examples_build_end()
1 change: 1 addition & 0 deletions examples/examples.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TEMPLATE = subdirs
1 change: 1 addition & 0 deletions qtnostr.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
load(qt_parts)
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated from src.pro.

add_subdirectory(nostr)
35 changes: 35 additions & 0 deletions src/nostr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Generated from httpserver.pro.

#####################################################################
## Nostr Module:
#####################################################################

include_directories(../thirdparty/secp256k1/include/)

add_compile_definitions(ENABLE_MODULE_ECDH)
add_compile_definitions(ENABLE_MODULE_RECOVERY)
add_compile_definitions(ENABLE_MODULE_EXTRAKEYS)
add_compile_definitions(ENABLE_MODULE_SCHNORRSIG)
add_compile_definitions(ENABLE_MODULE_ELLSWIFT)

include_directories(${OPENSSL_INCLUDE_DIRS})

qt_internal_add_module(Nostr
SOURCES
qnostr.h
qnostrrelay.h
qtnostr_global.h

qnostr.cpp
qnostrrelay.cpp

../thirdparty/secp256k1/src/secp256k1.c
../thirdparty/secp256k1/src/precomputed_ecmult_gen.c
../thirdparty/secp256k1/src/precomputed_ecmult.c

LIBRARIES
Qt::Core
Qt::Network
Qt::WebSockets
${OPENSSL_LIBRARIES}
)
41 changes: 41 additions & 0 deletions src/nostr/nostr.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
INCLUDEPATH += .
QT = network core websockets

CONFIG += c++17

linux: !android {
isEmpty(OPENSSL_LIB_PATH): OPENSSL_LIB_PATH = /usr
} else {
isEmpty(OPENSSL_LIB_PATH): OPENSSL_LIB_PATH = $$[QT_INSTALL_DATA]
}
isEmpty(OPENSSL_LIB_PATH): OPENSSL_LIB_PATH = $$OPENSS_LIB_PATH
exists($$OPENSSL_LIB_PATH/include/openssl/conf.h) {
message(OpenSSL libs found on $$OPENSSL_LIB_PATH)
} else {
OPENSSL_LIB_PATH = $$getenv(OPENSSL_LIB_PATH)
exists($$OPENSSL_LIB_PATH/include/openssl/conf.h) {
message(OpenSSL libs found on $$OPENSSL_LIB_PATH)
} else {
error(Could not find OpenSSL lib directory. Please set it using OPENSSL_LIB_PATH argument)
}
}

INCLUDEPATH += \
$$OPENSSL_LIB_PATH/include

win32-msvc* {
LIBS += -L$$[QT_INSTALL_LIBS] -L$$OPENSSL_LIB_PATH/lib -llibssl -llibcrypto
} else {
LIBS += -L$$[QT_INSTALL_LIBS] -L$$OPENSSL_LIB_PATH/lib -lssl -lcrypto
}

include(../thirdparty/thirdparty.pri)

SOURCES += \
$$PWD/qnostr.cpp \
$$PWD/qnostrrelay.cpp

HEADERS += \
$$PWD/qnostr.h \
$$PWD/qnostrrelay.h \
$$PWD/qtnostr_global.h
12 changes: 12 additions & 0 deletions src/nostr/nostr.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
load(qt_build_config)

TARGET = QNostr

MODULE = nostr


load(qt_module)

DEFINES += LIBQTNOSTR_CORE_LIBRARY

include(nostr.pri)
Loading

0 comments on commit 3f3b6de

Please sign in to comment.