update to 0.0.2

This commit is contained in:
Neil Hanlon 2023-01-12 14:32:01 -05:00
parent ccca4cfc72
commit bd8930e525
Signed by: neil
GPG Key ID: 705BC21EC3C70F34
2 changed files with 52 additions and 59 deletions

View File

@ -1,18 +1,7 @@
From 8146d440a24b262c2fabde0da1df9035404a4c11 Mon Sep 17 00:00:00 2001
From: Neil Hanlon <neil@rockylinux.org>
Date: Fri, 30 Dec 2022 23:49:37 -0500
Subject: [PATCH] Fix cmake
---
CMakeLists.txt | 80 ++++++++++++++++++++++----------------
tools/blisp/CMakeLists.txt | 14 ++++---
2 files changed, 55 insertions(+), 44 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2288949..fa22831 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,41 +32,55 @@ set_target_properties(libblisp_static PROPERTIES
diff -ru blisp-0.0.2/CMakeLists.txt blisp-0.0.2-b/CMakeLists.txt
--- blisp-0.0.2/CMakeLists.txt 2023-01-12 05:49:04.000000000 -0500
+++ blisp-0.0.2-b/CMakeLists.txt 2023-01-12 14:31:14.092073606 -0500
@@ -32,29 +32,18 @@
ARCHIVE_OUTPUT_DIRECTORY "static"
OUTPUT_NAME "blisp")
@ -22,12 +11,12 @@ index 2288949..fa22831 100644
-
-target_include_directories(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport)
-
-if(WIN32)
- target_link_libraries(libblisp_obj PRIVATE Setupapi.lib)
- target_compile_definitions(libblisp_obj PRIVATE LIBSERIALPORT_MSBUILD)
- target_sources(libblisp_obj PRIVATE
- ${CMAKE_SOURCE_DIR}/vendor/libserialport/windows.c)
-elseif(UNIX AND NOT APPLE)
if(WIN32)
target_link_libraries(libblisp_obj PRIVATE Setupapi.lib)
target_compile_definitions(libblisp_obj PRIVATE LIBSERIALPORT_MSBUILD)
target_sources(libblisp_obj PRIVATE
${CMAKE_SOURCE_DIR}/vendor/libserialport/windows.c)
elseif(UNIX AND NOT APPLE)
- target_sources(libblisp_obj PRIVATE
- ${CMAKE_SOURCE_DIR}/vendor/libserialport/linux.c
- ${CMAKE_SOURCE_DIR}/vendor/libserialport/linux_termios.c)
@ -39,34 +28,28 @@ index 2288949..fa22831 100644
- "SP_API=__attribute__((visibility(\"default\")))"
- "SP_PRIV=__attribute__((visibility(\"hidden\")))")
- write_file(${CMAKE_SOURCE_DIR}/vendor/libserialport/config.h "// bypass errors.")
-elseif(APPLE)
- target_sources(libblisp_obj PRIVATE
- ${CMAKE_SOURCE_DIR}/vendor/libserialport/macosx.c)
- target_link_libraries(libblisp PRIVATE "-framework IOKit" "-framework CoreFoundation")
- target_compile_definitions(libblisp_obj PRIVATE
- LIBSERIALPORT_ATBUILD
- "SP_PRIV=__attribute__((visibility(\"hidden\")))"
- "SP_API=__attribute__((visibility(\"default\")))")
- target_include_directories(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport)
- write_file(${CMAKE_SOURCE_DIR}/vendor/libserialport/config.h "// bypass errors.")
+find_package(PkgConfig)
+pkg_check_modules(LIBSP REQUIRED libserialport>=0.1.1)
+
+target_link_libraries(libblisp_obj PRIVATE ${LIBSP_LIBRARIES})
+target_include_directories(libblisp_obj PRIVATE ${LIBSP_INCLUDE_DIRS})
+target_compile_options(libblisp_obj PUBLIC ${LIBSP_CFLAGS_OTHER})
+
+ find_package(PkgConfig)
+ pkg_check_modules(LIBSP REQUIRED libserialport>=0.1.1)
+
+ target_link_libraries(libblisp_obj PRIVATE ${LIBSP_LIBRARIES})
+ target_include_directories(libblisp_obj PRIVATE ${LIBSP_INCLUDE_DIRS})
+ target_compile_options(libblisp_obj PUBLIC ${LIBSP_CFLAGS_OTHER})
elseif(APPLE)
target_sources(libblisp_obj PRIVATE
${CMAKE_SOURCE_DIR}/vendor/libserialport/macosx.c)
@@ -67,6 +56,49 @@
write_file(${CMAKE_SOURCE_DIR}/vendor/libserialport/config.h "// bypass errors.")
endif()
+set(BLISP_PACKAGE_NAME Blisp)
+set(BLISP_VERSION 1.0.0)
+
+set(BLISP_VERSION 0.0.2)
+include(GNUInstallDirs)
+if(UNIX OR MSYS OR MINGW)
+ set(BLISP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/blisp)
+elseif(WIN32)
+ set(BLISP_INSTALL_CMAKEDIR "cmake")
endif()
+endif()
+
if(BLISP_BUILD_CLI)
add_subdirectory(tools/blisp)
+ install(TARGETS blisp
@ -81,7 +64,10 @@ index 2288949..fa22831 100644
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+)
+
+file(GLOB HEADER_FILES "${PROJECT_SOURCE_DIR}/include/*.h")
+file(GLOB HEADER_FILES
+ "${PROJECT_SOURCE_DIR}/include/*.h"
+ "${PROJECT_SOURCE_DIR}/data/*.h"
+)
+
+install(FILES ${HEADER_FILES}
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
@ -101,15 +87,16 @@ index 2288949..fa22831 100644
+install(FILES "${PROJECT_BINARY_DIR}/${BLISP_PACKAGE_NAME}ConfigVersion.cmake"
+ DESTINATION ${BLISP_INSTALL_CMAKEDIR}
+)
diff --git a/tools/blisp/CMakeLists.txt b/tools/blisp/CMakeLists.txt
index 6cb53f4..c345fd5 100644
--- a/tools/blisp/CMakeLists.txt
+++ b/tools/blisp/CMakeLists.txt
@@ -1,17 +1,19 @@
diff -ru blisp-0.0.2/tools/blisp/CMakeLists.txt blisp-0.0.2-b/tools/blisp/CMakeLists.txt
--- blisp-0.0.2/tools/blisp/CMakeLists.txt 2023-01-12 05:49:04.000000000 -0500
+++ blisp-0.0.2-b/tools/blisp/CMakeLists.txt 2023-01-12 14:20:35.839890965 -0500
@@ -1,20 +1,21 @@
set(ARGTABLE3_ENABLE_TESTS OFF CACHE BOOL "Enable unit tests")
set(ARGTABLE3_ENABLE_EXAMPLES OFF CACHE BOOL "Enable examples")
#set(ARGTABLE3_REPLACE_GETOPT OFF CACHE BOOL "Replace getopt in the system C library")
-add_subdirectory(${CMAKE_SOURCE_DIR}/vendor/argtable3 ${CMAKE_CURRENT_BINARY_DIR}/argtable3)
+# add_subdirectory(${CMAKE_SOURCE_DIR}/vendor/argtable3 ${CMAKE_CURRENT_BINARY_DIR}/argtable3)
add_executable(blisp src/main.c src/cmd/write.c)
add_executable(blisp src/main.c src/cmd/write.c src/util.c src/common.c src/cmd/iot.c)
-target_include_directories(blisp PRIVATE
- "${CMAKE_SOURCE_DIR}/include"
@ -124,11 +111,11 @@ index 6cb53f4..c345fd5 100644
+ ${LIBSP_LIBRARIES}
libblisp_static)
if(WIN32)
if (WIN32)
target_link_libraries(blisp PRIVATE Setupapi.lib)
elseif(APPLE)
elseif (APPLE)
target_link_libraries(blisp PRIVATE "-framework IOKit" "-framework CoreFoundation")
-endif()
-endif ()
\ No newline at end of file
+endif()
+endif ()
+

View File

@ -1,11 +1,12 @@
Name: blisp
Version: 0.0.1
Release: 2%{?dist}
Version: 0.0.2
Release: 0%{?dist}
Summary: Bouffalo Labs ISP tool/library for flashing Bouffalo RISC-V MCUs
URL: https://github.com/pine64/blisp
License: MIT
License: MIT, Apache
Source0: https://git.shrug.pw/api/packages/neil/generic/%{name}/%{version}/%{name}-%{version}.tar.gz
%dnl Source0: https://git.shrug.pw/api/packages/neil/generic/%{name}/%{version}/%{name}-%{version}.tar.gz
Source0: https://github.com/pine64/%{name}/archive/refs/tags/v%{version}.tar.gz
Patch0: 0001-Fix-cmake.patch
BuildRequires: gcc cmake make
@ -29,7 +30,8 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
Header and development files for using blisp
%prep
%autosetup -p 1 -n blisp
%autosetup -p 1 -n %{name}-%{version}
rm -rv vendor/
%build
%cmake -DBLISP_BUILD_CLI=ON
@ -44,11 +46,15 @@ Header and development files for using blisp
%files devel
%{_includedir}/blisp*.h
%{_includedir}/bl?0x_eflash_loader.h
%{_libdir}/cmake/blisp/*
%ldconfig_scriptlets
%changelog
* Thu Jan 12 2023 Neil Hanlon <neil@shrug.pw> - 0.0.2-0
- Update to upstream 0.0.2 and fix cmakelists patch
* Fri Dec 30 2022 Neil Hanlon <neil@shrug.pw> - 0.0.1-2
- fix requires