[Git][debian-gis-team/osmpbf][upstream] New upstream version 1.5.1

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Wed Mar 13 05:41:23 GMT 2024



Bas Couwenberg pushed to branch upstream at Debian GIS Project / osmpbf


Commits:
2c04af8b by Bas Couwenberg at 2024-03-13T05:34:29+01:00
New upstream version 1.5.1
- - - - -


18 changed files:

- .github/workflows/c.yml
- .github/workflows/java.yml
- CMakeLists.txt
- README.md
- + build.sh
- + build.xml
- − osmpbf
- src/CMakeLists.txt → osmpbf/CMakeLists.txt
- src/LICENSE → osmpbf/LICENSE
- src/fileformat.proto → osmpbf/fileformat.proto
- src/osmformat.proto → osmpbf/osmformat.proto
- pom.xml
- src.java/crosby/binary/file/BlockOutputStream.java
- + src.java/crosby/binary/file/CompressFlags.java
- − src/Makefile
- tools/CMakeLists.txt
- − tools/Makefile
- tools/osmpbf-outline.cpp


Changes:

=====================================
.github/workflows/c.yml
=====================================
@@ -3,56 +3,44 @@ name: C CI
 on: [push, pull_request]
 
 jobs:
-  ubuntu16:
-    runs-on: ubuntu-16.04
+  ubuntu20:
+    runs-on: ubuntu-20.04
     env:
       CC: gcc
       CXX: g++
       CXXFLAGS: -Werror -Wall -pedantic
       BUILD_TYPE: Debug
     steps:
-      - uses: actions/checkout at v2
+      - uses: actions/checkout at v4
       - uses: ./.github/actions/install-ubuntu
       - uses: ./.github/actions/build
 
-  ubuntu18:
-    runs-on: ubuntu-18.04
+  ubuntu22:
+    runs-on: ubuntu-22.04
     env:
       CC: gcc
       CXX: g++
       CXXFLAGS: -Werror -Wall -pedantic
       BUILD_TYPE: Debug
     steps:
-      - uses: actions/checkout at v2
+      - uses: actions/checkout at v4
       - uses: ./.github/actions/install-ubuntu
       - uses: ./.github/actions/build
 
-  ubuntu20:
-    runs-on: ubuntu-20.04
+  ubuntu22-clang:
+    runs-on: ubuntu-22.04
     env:
-      CC: gcc
-      CXX: g++
+      CC: clang-15
+      CXX: clang++-15
       CXXFLAGS: -Werror -Wall -pedantic
       BUILD_TYPE: Debug
     steps:
-      - uses: actions/checkout at v2
+      - uses: actions/checkout at v4
       - uses: ./.github/actions/install-ubuntu
       - uses: ./.github/actions/build
 
-  ubuntu20-clang:
-    runs-on: ubuntu-20.04
-    env:
-      CC: clang-10
-      CXX: clang++-10
-      CXXFLAGS: -Werror -Wall -pedantic
-      BUILD_TYPE: Debug
-    steps:
-      - uses: actions/checkout at v2
-      - uses: ./.github/actions/install-ubuntu
-      - uses: ./.github/actions/build
-
-  ubuntu20-release:
-    runs-on: ubuntu-20.04
+  ubuntu22-release:
+    runs-on: ubuntu-22.04
     env:
       CC: gcc
       CXX: g++
@@ -60,21 +48,10 @@ jobs:
       CXXFLAGS: -Werror -Wall -pedantic -Wno-array-bounds
       BUILD_TYPE: Release
     steps:
-      - uses: actions/checkout at v2
+      - uses: actions/checkout at v4
       - uses: ./.github/actions/install-ubuntu
       - uses: ./.github/actions/build
 
-  ubuntu20-make:
-    runs-on: ubuntu-20.04
-    env:
-      CC: gcc
-      CXX: g++
-      CXXFLAGS: -Werror -Wall -pedantic
-    steps:
-      - uses: actions/checkout at v2
-      - uses: ./.github/actions/install-ubuntu
-      - run: make -C src
-
   macos:
     runs-on: macos-latest
     env:
@@ -83,14 +60,14 @@ jobs:
       CXXFLAGS: -Werror -Wall -pedantic
       BUILD_TYPE: Debug
     steps:
-      - uses: actions/checkout at v2
+      - uses: actions/checkout at v4
       - uses: ./.github/actions/install-macos
       - uses: ./.github/actions/build
 
   windows:
     runs-on: windows-latest
     steps:
-      - uses: actions/checkout at v2
+      - uses: actions/checkout at v4
       - uses: ./.github/actions/install-windows
       - uses: ./.github/actions/build-windows
 


=====================================
.github/workflows/java.yml
=====================================
@@ -3,11 +3,22 @@ name: Java CI
 on: [push, pull_request]
 
 jobs:
-  build:
-    runs-on: ubuntu-latest
+  maven-ubuntu20:
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout at v4
+      - run: sudo apt-get install protobuf-compiler
+      - name: Set up JDK 1.8
+        uses: actions/setup-java at v1
+        with:
+          java-version: 1.8
+      - name: Build with Maven
+        run: mvn -B package --file pom.xml
 
+  maven-ubuntu22:
+    runs-on: ubuntu-22.04
     steps:
-      - uses: actions/checkout at v2
+      - uses: actions/checkout at v4
       - run: sudo apt-get install protobuf-compiler
       - name: Set up JDK 1.8
         uses: actions/setup-java at v1
@@ -15,3 +26,28 @@ jobs:
           java-version: 1.8
       - name: Build with Maven
         run: mvn -B package --file pom.xml
+
+  ant-ubuntu20:
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout at v4
+      - run: sudo apt-get install protobuf-compiler libprotobuf-java
+      - name: Set up JDK 1.8
+        uses: actions/setup-java at v1
+        with:
+          java-version: 1.8
+      - name: Build with Ant
+        run: ant
+
+  ant-ubuntu22:
+    runs-on: ubuntu-22.04
+    steps:
+      - uses: actions/checkout at v4
+      - run: sudo apt-get install protobuf-compiler libprotobuf-java
+      - name: Set up JDK 1.8
+        uses: actions/setup-java at v1
+        with:
+          java-version: 1.8
+      - name: Build with Ant
+        run: ant
+


=====================================
CMakeLists.txt
=====================================
@@ -4,7 +4,13 @@ project(osmpbf VERSION 1.5.0)
 
 include(GNUInstallDirs)
 
-set(CMAKE_CXX_STANDARD 11)
+# This is needed for the protobuf_generate_cpp() function to work on newer
+# versions of the Protobuf CMake config.
+set(protobuf_MODULE_COMPATIBLE ON CACHE BOOL "")
+
+# This is needed so that we pick up the (more modern) CONFIG mode cmake file
+# before the (older) MODULE mode cmake config file. Seems to be needed on macOS.
+set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
 
 find_package(Protobuf REQUIRED)
 


=====================================
README.md
=====================================
@@ -3,7 +3,7 @@
 
 https://github.com/openstreetmap/OSM-binary
 
-Osmpbf is a Java/C library to read and write OpenStreetMap PBF files.
+Osmpbf is a Java/C++ library to read and write OpenStreetMap PBF files.
 PBF (Protocol buffer Binary Format) is a binary file format for OpenStreetMap
 data that uses Google Protocol Buffers as low-level storage.
 
@@ -13,11 +13,14 @@ Note that this is a low-level library that does only part of the
 encoding/decoding needed for actually writing/reading an OSM PBF file. For
 something more complete see [libosmium](https://osmcode.org/libosmium/).
 
-[![Github Actions C Build Status](https://github.com/openstreetmap/OSM-binary/workflows/C%20CI/badge.svg?branch=master)](https://github.com/openstreetmap/OSM-binary/actions)
-[![Github Actions Java Build Status](https://github.com/openstreetmap/OSM-binary/workflows/Java%20CI/badge.svg?branch=master)](https://github.com/openstreetmap/OSM-binary/actions)
+[![Github Actions C++ CI](https://github.com/openstreetmap/OSM-binary/actions/workflows/c.yml/badge.svg)](https://github.com/openstreetmap/OSM-binary/actions/workflows/c.yml)
+[![Github Actions Java CI](https://github.com/openstreetmap/OSM-binary/actions/workflows/java.yml/badge.svg)](https://github.com/openstreetmap/OSM-binary/actions/workflows/java.yml)
+[![Packaging status](https://repology.org/badge/tiny-repos/libosmpbf.svg)](https://repology.org/project/libosmpbf/versions)
 
 ## Java Version
 
+### Building with Maven
+
 We publish the Java library to [Maven Central](https://search.maven.org/):
 
 ```xml
@@ -34,13 +37,23 @@ To build the Java library run:
 mvn package
 ```
 
-For a Java usage example, see [`ReadFileTest`](https://github.com/openstreetmap/OSM-binary/blob/master/test.java/crosby/binary/ReadFileTest.java)
+For a Java usage example, see
+[`ReadFileTest`](https://github.com/openstreetmap/OSM-binary/blob/master/test.java/crosby/binary/ReadFileTest.java).
 
+### Building with Ant
 
-## C++ Version
+If you can not use Maven for some reason you can use the
+[Ant](https://ant.apache.org/) instead:
+
+```sh
+ant
+```
+
+This will build `osmpbf.jar` in the main directory.
 
-(Earlier versions used Makefiles for building. Please switch to the CMake-based
-build, the Makefiles are deprecated and will be removed in a future version.)
+This build is also used for Debian packaging.
+
+## C++ Version
 
 To compile:
 


=====================================
build.sh
=====================================
@@ -0,0 +1,2 @@
+protoc --java_out=generated.java osmpbf/osmformat.proto
+protoc --java_out=generated.java osmpbf/fileformat.proto


=====================================
build.xml
=====================================
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="osmpbf" default="all" basedir=".">
+
+	<property name="src.dir" location="src.java"/>
+	<property name="src.generated.dir" location="generated.java"/>
+	<property name="build.dir" location="build"/>
+	<property name="build.jar" location="osmpbf.jar"/>
+
+	<target name="init">
+		<mkdir dir="${src.generated.dir}"/>
+		<mkdir dir="${build.dir}"/>
+	</target>
+
+	<target name="clean">
+		<delete dir="${src.generated.dir}"/>
+		<delete dir="${build.dir}"/>
+		<delete file="${build.jar}"/>
+	</target>
+
+	<target name="build" depends="init">
+		<exec executable="/bin/sh">
+			<arg value="./build.sh"/>
+		</exec>
+		<javac includeantruntime="false" destdir="${build.dir}">
+			<src path="${src.dir}"/>
+			<src path="${src.generated.dir}"/>
+			<classpath>
+				<fileset file="/usr/share/java/protobuf.jar"/>
+				<fileset file="/usr/share/java/protobuf-java.jar"/>
+			</classpath>
+		</javac>
+	</target>
+
+	<target name="dist" depends="build">
+		<jar destfile="${build.jar}" basedir="${build.dir}"/>
+	</target>
+	
+	<target name="all" depends="dist">
+	</target>
+
+</project>
+


=====================================
osmpbf deleted
=====================================
@@ -1 +0,0 @@
-src
\ No newline at end of file


=====================================
src/CMakeLists.txt → osmpbf/CMakeLists.txt
=====================================
@@ -1,10 +1,13 @@
 protobuf_generate_cpp(CPPS HS fileformat.proto osmformat.proto)
 
 add_library(osmpbf STATIC ${CPPS})
+target_compile_features(osmpbf PUBLIC cxx_std_11)
+target_link_libraries(osmpbf PRIVATE protobuf::libprotobuf)
 target_include_directories(osmpbf SYSTEM PUBLIC ${Protobuf_INCLUDE_DIRS})
 install(TARGETS osmpbf ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
 
 add_library(osmpbf_shared SHARED ${CPPS})
+target_compile_features(osmpbf_shared PUBLIC cxx_std_11)
 target_link_libraries(osmpbf_shared PRIVATE protobuf::libprotobuf)
 target_include_directories(osmpbf_shared SYSTEM PUBLIC ${Protobuf_INCLUDE_DIRS})
 set_target_properties(osmpbf_shared PROPERTIES OUTPUT_NAME osmpbf


=====================================
src/LICENSE → osmpbf/LICENSE
=====================================


=====================================
src/fileformat.proto → osmpbf/fileformat.proto
=====================================


=====================================
src/osmformat.proto → osmpbf/osmformat.proto
=====================================


=====================================
pom.xml
=====================================
@@ -70,7 +70,7 @@
             </goals>
             <phase>generate-sources</phase>
             <configuration>
-              <protoSourceRoot>${basedir}/src</protoSourceRoot>
+              <protoSourceRoot>${basedir}/osmpbf</protoSourceRoot>
               <includes>
                 <param>**/*.proto</param>
               </includes>
@@ -143,7 +143,7 @@
     <dependency>
       <groupId>com.google.protobuf</groupId>
       <artifactId>protobuf-java</artifactId>
-      <version>3.13.0</version>
+      <version>3.16.3</version>
     </dependency>
   </dependencies>
 


=====================================
src.java/crosby/binary/file/BlockOutputStream.java
=====================================
@@ -25,10 +25,6 @@ import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.List;
 
-enum CompressFlags {
-    NONE, DEFLATE
-}
-
 public class BlockOutputStream implements Closeable, Flushable {
 
     public BlockOutputStream(OutputStream output) {


=====================================
src.java/crosby/binary/file/CompressFlags.java
=====================================
@@ -0,0 +1,5 @@
+package crosby.binary.file;
+
+public enum CompressFlags {
+    NONE, DEFLATE
+}
\ No newline at end of file


=====================================
src/Makefile deleted
=====================================
@@ -1,44 +0,0 @@
-
-# these default settings can be overridden by setting environment variables
-PREFIX   ?= /usr/local
-LIBDIR   ?= $(PREFIX)/lib
-CXX      ?= g++
-CXXFLAGS ?= -O3
-AR       ?= ar
-PROTOC   ?= protoc
-SONAME   ?= libosmpbf.so.1
-VERSION  ?= 1.5.0
-
-CXXFLAGS += -Wall -Wextra -pedantic -Wredundant-decls -Wdisabled-optimization -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo -Wno-long-long
-
-.PHONY: clean install
-
-all: libosmpbf.a libosmpbf.so ../include/osmpbf/fileformat.pb.h ../include/osmpbf/osmformat.pb.h
-
-libosmpbf.a: fileformat.pb.o osmformat.pb.o
-	$(AR) -cr $@ fileformat.pb.o osmformat.pb.o
-
-libosmpbf.so: fileformat.pb.o osmformat.pb.o
-	$(CXX) $(CPPFLAGS) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ fileformat.pb.o osmformat.pb.o
-
-%.pb.o: %.pb.cc
-	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -fPIC -c -o $@ $<
-
-%.pb.cc ../include/osmpbf/%.pb.h: %.proto
-	$(PROTOC) --proto_path=. --cpp_out=. $<
-	cp -v $(subst .proto,.pb.h,$<) ../include/osmpbf/
-
-install:
-	install -m 755 -d $(DESTDIR)$(LIBDIR)
-	install -m 644 libosmpbf.a $(DESTDIR)$(LIBDIR)
-	install -m 755 libosmpbf.so $(DESTDIR)$(LIBDIR)/libosmpbf.so.$(VERSION)
-	ln -s libosmpbf.so.$(VERSION) $(DESTDIR)$(LIBDIR)/$(SONAME)
-	ln -s libosmpbf.so.$(VERSION) $(DESTDIR)$(LIBDIR)/libosmpbf.so
-	install -m 755 -d $(DESTDIR)$(PREFIX)/include/osmpbf
-	install -m 644 ../include/osmpbf/osmpbf.h $(DESTDIR)$(PREFIX)/include/osmpbf
-	install -m 644 ../include/osmpbf/fileformat.pb.h $(DESTDIR)$(PREFIX)/include/osmpbf
-	install -m 644 ../include/osmpbf/osmformat.pb.h $(DESTDIR)$(PREFIX)/include/osmpbf
-
-clean:
-	rm -f *.pb.h *.pb.cc *.pb.o libosmpbf.a
-


=====================================
tools/CMakeLists.txt
=====================================
@@ -10,6 +10,7 @@ add_executable(osmpbf-outline osmpbf-outline.cpp)
 
 target_include_directories(osmpbf-outline SYSTEM PRIVATE ${ZLIB_INCLUDE_DIR})
 target_link_libraries(osmpbf-outline PRIVATE osmpbf ZLIB::ZLIB protobuf::libprotobuf)
+set_property(TARGET osmpbf-outline PROPERTY CXX_STANDARD 11)
 
 install(TARGETS osmpbf-outline RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 install(FILES osmpbf-outline.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)


=====================================
tools/Makefile deleted
=====================================
@@ -1,23 +0,0 @@
-
-# these default settings can be overridden by setting environment variables
-PREFIX   ?= /usr/local
-CXX      ?= g++
-CXXFLAGS ?= -g
-
-CXXFLAGS += -I../include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wextra -pedantic -Wredundant-decls -Wdisabled-optimization -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo -Wno-long-long
-LDFLAGS  += -L../src -pthread -lz -lprotobuf -losmpbf
-
-.PHONY: clean install
-
-all: osmpbf-outline
-
-osmpbf-outline: osmpbf-outline.cpp
-	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< $(LDFLAGS)
-
-install:
-	install -m 755 -d $(DESTDIR)$(PREFIX)/bin
-	install -m 755 -s osmpbf-outline $(DESTDIR)$(PREFIX)/bin
-
-clean:
-	rm -f osmpbf-outline
-


=====================================
tools/osmpbf-outline.cpp
=====================================
@@ -1,3 +1,6 @@
+// used for 'isatty'
+#include <unistd.h>
+
 // used for va_list in debug-print methods
 #include <stdarg.h>
 



View it on GitLab: https://salsa.debian.org/debian-gis-team/osmpbf/-/commit/2c04af8b8c231267b6cfb009a27ba9edf5ac0c3a

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/osmpbf/-/commit/2c04af8b8c231267b6cfb009a27ba9edf5ac0c3a
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20240313/52c26372/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list