Navigation Menu

Skip to content

Commit

Permalink
package windows: add cv2pdb
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 16, 2017
1 parent f862810 commit 96c3952
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 deletions.
9 changes: 9 additions & 0 deletions packages/windows/Makefile.am
Expand Up @@ -133,6 +133,15 @@ LICENSE:
echo "-------"; \
echo; \
cat $(LICENSE_DIR)/naist-jdic/COPYING; \
echo; \
echo; \
echo "cv2pdb"; \
echo "======"; \
echo; \
echo "LICENSE"; \
echo "-------"; \
echo; \
cat $(LICENSE_DIR)/cv2pdb/LICENSE; \
) > LICENSE

installer: installer-x86 installer-x64
Expand Down
36 changes: 32 additions & 4 deletions packages/windows/Rakefile
Expand Up @@ -54,7 +54,7 @@ else
end

def download(url, download_dir)
base_name = url.split("/").last
base_name = url.split("/").last.split("?", 2)[0]
absolute_output_path = download_dir + base_name

unless absolute_output_path.exist?
Expand All @@ -70,9 +70,8 @@ def download(url, download_dir)
absolute_output_path
end

download_dir = base_tmp_dir + "download"
namespace :build do
download_dir = base_tmp_dir + "download"

task :pkg_config do
ENV["PKG_CONFIG_PATH"] = nil
ENV["PKG_CONFIG_LIBDIR"] = (lib_dir + "pkgconfig").to_s
Expand Down Expand Up @@ -497,8 +496,37 @@ namespace :gcc do
end
end

namespace :pdb do
namespace :extractor do
desc "Generate PDB extractor"
task :generate do
cv2pdb_url = "https://ci.appveyor.com/api/projects/rainers/visuald/artifacts/cv2pdb.exe?job=Environment%3A%20os%3DVisual%20Studio%202013%2C%20VS%3D12%2C%20APPVEYOR_BUILD_WORKER_IMAGE%3DVisual%20Studio%202015"
cv2pdb = download(cv2pdb_url, download_dir)
chmod(0755, cv2pdb)
generate_pdb_bat = bin_dir + "generate_pdb.bat"
generate_pdb_bat.open("w") do |bat|
cd(bin_dir) do
Dir.glob("*.{exe,dll}") do |binary|
bat.print("#{cv2pdb.basename} #{binary}\r\n")
end
end
end
chmod(0755, generate_pdb_bat)
cp(cv2pdb, bin_dir)

cv2pdb_license_dir = license_dir + "cv2pdb"
mkdir_p(cv2pdb_license_dir)
files = ["README", "LICENSE"].collect do |file|
download("https://raw.githubusercontent.com/rainers/cv2pdb/master/#{file}",
download_dir)
end
cp(files, cv2pdb_license_dir)
end
end
end

task "build:mecab_dict" => "gcc:dll:bundle"
task "build:post" => "gcc:dll:bundle"
task "build:post" => ["gcc:dll:bundle", "pdb:extractor:generate"]

build_dependencies = [
"build:pre",
Expand Down

0 comments on commit 96c3952

Please sign in to comment.