rb_sys 0.9.21 → 0.9.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ef1de2cec5dcbbaaa9d8cc147b9bf727ce66c3beeb03ac6966549677a58a666
4
- data.tar.gz: 5a693be7f33111e218293d7f6ff1e1ed8b4b3f1e238384a7c5f2d29ee654e713
3
+ metadata.gz: 63ba0fbfb3a21414b8e379d92abf8cf37ca5b310e57360d57d42d10a1aa42b22
4
+ data.tar.gz: 54ab9824e5902fbe11416cd8be8529fb90f9129412bbe916b5195270ca54fb9d
5
5
  SHA512:
6
- metadata.gz: c3b0b95982617b6df58a1e78359858fce84510559386f537de606781bbb4d1e9431c349830ac1655140b373ec57f29b48b26705d715056d1a50b30233b362775
7
- data.tar.gz: 2fc14bb752c42481d37de6b6f5e12fbcd43f55b580ddd9dc7ef158ee836fce241a990fc1b96dfa8b5babb055df5cdf828824f1983bf76a0cebddaec99442565c
6
+ metadata.gz: 523f540fdbfabed2e6988871ec2bd4f2d97a20c5ab0c39a8b10181dacff50a6c32cfcfaafe1335d6f4d5454458201feb20df7fb2fc14f6a28a8b9df7c077b1c8
7
+ data.tar.gz: a49dc910f814519fc42d37c08ba3ce52729b90ca47bc08a1f48f9edba26e54c7bcfe234ce952b80c0a2a8a88f82565bfc7784f9ee067e92b3bbade2cc7bda4dc
checksums.yaml.gz.sig CHANGED
Binary file
@@ -4,11 +4,12 @@ module RbSys
4
4
  module Mkmf
5
5
  # Config that delegates to CargoBuilder if needded
6
6
  class Config
7
- attr_accessor :force_install_rust_toolchain
7
+ attr_accessor :force_install_rust_toolchain, :clean_after_install
8
8
 
9
9
  def initialize(builder)
10
10
  @builder = builder
11
11
  @force_install_rust_toolchain = false
12
+ @clean_after_install = rubygems_invoked?
12
13
  end
13
14
 
14
15
  def method_missing(name, *args, &blk)
@@ -18,6 +19,15 @@ module RbSys
18
19
  def respond_to_missing?(name, include_private = false)
19
20
  @builder.respond_to?(name) || super
20
21
  end
22
+
23
+ private
24
+
25
+ # Seems to be the only way to reliably know if we were invoked by Rubygems.
26
+ # We want to know this so we can cleanup the target directory after an
27
+ # install, to remove bloat.
28
+ def rubygems_invoked?
29
+ ENV.key?("SOURCE_DATE_EPOCH")
30
+ end
21
31
  end
22
32
  end
23
33
  end
data/lib/rb_sys/mkmf.rb CHANGED
@@ -88,14 +88,14 @@ module RbSys
88
88
  target_prefix = #{target_prefix}
89
89
  TARGET_NAME = #{target[/\A\w+/]}
90
90
  TARGET_ENTRY = #{RbConfig::CONFIG["EXPORT_PREFIX"]}Init_$(TARGET_NAME)
91
- CLEANLIBS = $(RUSTLIB) $(DLLIB) $(DEFFILE)
91
+ CLEANLIBS = $(RUSTLIB)
92
92
  RUBYARCHDIR = $(sitearchdir)$(target_prefix)
93
93
  TARGET = #{target}
94
94
  DLLIB = $(TARGET).#{RbConfig::CONFIG["DLEXT"]}
95
95
  TARGET_DIR = #{Dir.pwd}/$(RB_SYS_CARGO_BUILD_TARGET_DIR)/$(RB_SYS_CARGO_PROFILE_DIR)
96
96
  RUSTLIB = $(TARGET_DIR)/$(SOEXT_PREFIX)$(TARGET_NAME).$(SOEXT)
97
97
 
98
- DISTCLEANDIRS = $(TARGET_DIR) $(RB_SYS_BUILD_DIR)
98
+ CLEANOBJS = $(TARGET_DIR)/.fingerprint $(TARGET_DIR)/incremental $(TARGET_DIR)/examples $(TARGET_DIR)/deps $(TARGET_DIR)/build $(TARGET_DIR)/.cargo-lock $(TARGET_DIR)/*.d $(RB_SYS_BUILD_DIR)
99
99
  DEFFILE = $(TARGET_DIR)/$(TARGET)-$(arch).def
100
100
  #{base_makefile(srcdir)}
101
101
 
@@ -123,11 +123,13 @@ module RbSys
123
123
  \t$(Q) #{full_cargo_command}
124
124
  \t$(Q) $(COPY) "$(RUSTLIB)" $@
125
125
 
126
- install: $(DLLIB) Makefile
126
+ install-so: $(DLLIB) Makefile
127
127
  \t$(ECHO) installing $(DLLIB)
128
128
  \t$(Q) $(MAKEDIRS) $(RUBYARCHDIR)
129
129
  \t$(Q) $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
130
130
 
131
+ install: #{builder.clean_after_install ? "install-so realclean" : "install-so"}
132
+
131
133
  all: #{$extout ? "install" : "$(DLLIB)"}
132
134
  MAKE
133
135
 
@@ -141,8 +143,7 @@ module RbSys
141
143
 
142
144
  def base_makefile(cargo_dir)
143
145
  base_makefile = dummy_makefile(__dir__).join("\n")
144
- base_makefile.gsub!("all install static install-so install-rb", "all static install-so install-rb")
145
- base_makefile.gsub!("clean-so::", "clean-so:\n\t-$(Q)$(RM) $(DLLIB)\n")
146
+ base_makefile.gsub!("all install static install-so install-rb", "all static install-rb")
146
147
  base_makefile.gsub!(/^srcdir = .*$/, "srcdir = #{cargo_dir}")
147
148
  base_makefile
148
149
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RbSys
4
- VERSION = "0.9.21"
4
+ VERSION = "0.9.22"
5
5
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rb_sys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.21
4
+ version: 0.9.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ker-Seymer
metadata.gz.sig CHANGED
Binary file