Skip to content

Commit

Permalink
[liblrc] create a new port (microsoft#27023)
Browse files Browse the repository at this point in the history
* [lrc-tool] create a new port

* [lrc-tool] fix portfile.cmake

* [lrc-tool] fix format-manifest portfile.cmake

* [lrc-tool] fix git-tree version

* [liblrc] remove include  copy

* Update version database

* [liblrc] not support osx

* Update version database

* [liblrc] Apply suggestions from code review

Co-authored-by: Jack·Boos·Yu <[email protected]>

* [liblrc] fix code review

* Update version database

* [liblrc] make CMakeLists.txt to patch

* [liblrc] add unofficial

* [liblrc] add unofficial namespace

* [liblrc] Update version database

Co-authored-by: Jack·Boos·Yu <[email protected]>
Co-authored-by: luncliff <[email protected]>
  • Loading branch information
3 people authored Oct 13, 2022
1 parent ddd7eb8 commit 72bb4a7
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 0 deletions.
40 changes: 40 additions & 0 deletions ports/liblrc/fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6b2175e..2aa699b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,7 @@
cmake_minimum_required(VERSION 3.2.0)
project(LRCTools VERSION 1.0.0)

-set(CMAKE_CXX_FLAGS
- "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wno-missing-braces")
+set(CMAKE_CXX_STANDARD 11)

include_directories(${CMAKE_CURRENT_LIST_DIR})

@@ -12,7 +11,22 @@ include(CPack)

enable_testing()

-add_subdirectory(third_party)
add_subdirectory(liblrc)
-add_subdirectory(cli)
-add_subdirectory(test)
+# headers
+install(FILES ${PROJECT_SOURCE_DIR}/liblrc/lrc_parser.h
+ ${PROJECT_SOURCE_DIR}/liblrc/lyrics.h
+ ${PROJECT_SOURCE_DIR}/liblrc/utils.h
+ DESTINATION include/liblrc
+)
+# library with unofficial config
+install(TARGETS lrc
+ EXPORT unofficial-liblrcConfig
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
+# share/liblrc will be fixed in portfile.cmake
+install(EXPORT unofficial-liblrcConfig
+ NAMESPACE unofficial::liblrc::
+ DESTINATION share/unofficial-liblrc
+)
18 changes: 18 additions & 0 deletions ports/liblrc/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ywh233/LRC-Tools
REF 1fc3872320cd449933bffefc6527928262ee0629
SHA512 5b0a52a557ffb28554b33e77efb3832944facfd4e039d8afe60c322d56872eb12cb93f3974d17f083c659dcddf9c63075d3b09ba6abd3adba7b40b2ffb615f1c
PATCHES
set_up_compile_error.patch
fix-cmake.patch
)

vcpkg_cmake_configure(SOURCE_PATH ${SOURCE_PATH})
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-liblrc)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
13 changes: 13 additions & 0 deletions ports/liblrc/set_up_compile_error.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/liblrc/lyrics.cc b/liblrc/lyrics.cc
index b1a8c87..4fa16fa 100644
--- a/liblrc/lyrics.cc
+++ b/liblrc/lyrics.cc
@@ -5,7 +5,7 @@
//******************************************

#include "lyrics.h"
-
+#include <limits>
#include <assert.h>

#include <algorithm>
18 changes: 18 additions & 0 deletions ports/liblrc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "liblrc",
"version": "1.0.0",
"description": "Tools for parsing and playing back LRC lyrics.",
"homepage": "https://github.com/ywh233/LRC-Tools",
"license": "MIT",
"supports": "!osx",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3888,6 +3888,10 @@
"baseline": "0.31",
"port-version": 2
},
"liblrc": {
"baseline": "1.0.0",
"port-version": 0
},
"liblsl": {
"baseline": "1.16.0",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/liblrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "e335abcee36904e503939a5636403e7f42affc25",
"version": "1.0.0",
"port-version": 0
}
]
}

0 comments on commit 72bb4a7

Please sign in to comment.