Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sassc dependency to Gemfile #147

Merged
merged 9 commits into from
Jan 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
workflow_dispatch:

env:
CACHE_VER: 05
CACHE_VER: 07
OS_VER: "ubuntu-18.04"
BUILD_TYPE: Release
CC: clang
Expand All @@ -27,7 +27,7 @@ env:
TEBAKO_DIR: .archive/tebako
DEPS: deps
# Versions
TEBAKO_TAG: "v0.3.1"
TEBAKO_TAG: "v0.3.3"
RUBY_VER: "2.7.5"
RUBY_HASH: "2755b900a21235b443bb16dadd9032f784d4a88f143d852bc5d154f22b8781f1"
BUNDLER_VER: "2.2.3"
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
./configure --prefix='/usr'
make
sudo make install

- name: Checkout tebako packaging environment
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
./configure --prefix='/usr'
make
sudo make install

- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down Expand Up @@ -216,7 +216,6 @@ jobs:
- csa
- bipm
- ietf
- ogc
include:
- os: ubuntu-18.04
test-flavor: m3aawg
Expand All @@ -230,6 +229,9 @@ jobs:
- os: ubuntu-18.04
test-flavor: iho
ignore-errors: true
- os: ubuntu-18.04
test-flavor: ogc
ignore-errors: true
- os: ubuntu-20.04
test-flavor: m3aawg
ignore-errors: true
Expand All @@ -242,6 +244,9 @@ jobs:
- os: ubuntu-20.04
test-flavor: iho
ignore-errors: true
- os: ubuntu-20.04
test-flavor: ogc
ignore-errors: true
steps:
- uses: actions/checkout@v2

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ on:
workflow_dispatch:

env:
CACHE_VER: "03"
CACHE_VER: 05
BUILD_TYPE: Release
CC: clang
CXX: clang++
# The folders
TEBAKO_DIR: .archive/tebako
DEPS: deps
# Versions
TEBAKO_TAG: "v0.3.1"
TEBAKO_TAG: "v0.3.3"
RUBY_VER: "2.7.5"
RUBY_HASH: "2755b900a21235b443bb16dadd9032f784d4a88f143d852bc5d154f22b8781f1"
BUNDLER_VER: "2.2.3"
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ end

gem "ffi"
gem "rake"
gem "sassc"
gem "seven_zip_ruby"

group :development do
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ TEST_FLAVOR ?= iso
TEST_PROCESSORS ?= iso cc iec un m3aawg jcgm csa bipm iho ogc itu ietf

BUILD_DIR := build
TEBAKO_TAG := v0.3.3

all: $(BUILD_DIR)/bin/metanorma-$(PLATFORM)-$(ARCH)

Expand Down Expand Up @@ -49,7 +50,7 @@ test-flavor:

.archive/tebako/.git:
mkdir -p .archive;
git clone https://github.com/tamatebako/tebako $(dir $@)
git clone -b "$(TEBAKO_TAG)" https://github.com/tamatebako/tebako $(dir $@)

.archive/tebako/bin/tebako: .archive/tebako/.git

Expand Down
32 changes: 32 additions & 0 deletions bin/metanorma
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,38 @@ unless Gem.win_platform? # because on windows we use ocra
FileUtils.cp(sevenz_path, COMPILER_MEMFS_LIB_CACHE / 'seven_zip_ruby')
$LOAD_PATH.unshift(COMPILER_MEMFS_LIB_CACHE)
# END of HACK

# HACK unpack style files for sassc
require 'sassc'

module SassC
class Engine
@@loaded_pathes = []
@@loaded_pathes_semaphore = Mutex::new
def load_paths()
paths = (@options[:load_paths] || []) + SassC.load_paths
np = []
paths.each { |p|
if p.start_with?(COMPILER_MEMFS)
m = p.sub(COMPILER_MEMFS, COMPILER_MEMFS_LIB_CACHE.to_s)
@@loaded_pathes_semaphore.synchronize {
unless @@loaded_pathes.include?(m)
FileUtils.mkdir_p(m)
FileUtils.cp_r(File.join(p, "."), m) if File.exists?(p)
@@loaded_pathes << m
end
}
np << m
else
np << p
end
}
np.join(File::PATH_SEPARATOR) unless np.empty?
end
end
end
# END of HACK/sassc

end

if Gem.win_platform?
Expand Down